From 69aa73656e739f4fc8085bd5347fe081e2df9510 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 12 Feb 2010 17:43:47 +0000 Subject: CID-287 Checker: UNINIT_CTOR Function: LLScriptScript::LLScriptScript(LLScritpGlobalStorage *, LLScriptState *) File: /indra/lscript/lscript_compile/lscript_tree.cpp --- indra/lscript/lscript_compile/lscript_tree.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/lscript/lscript_compile/lscript_tree.cpp') diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index 3b8bbbe805..4ba41db2fc 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -10626,6 +10626,8 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals, } temp = temp->mNextp; } + + mClassName[0] = '\0'; } void LLScriptScript::setBytecodeDest(const char* dst_filename) -- cgit v1.2.3 From fa69f09e685bbb4b3b6faac825fd5c9af7100be5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:15:31 +0000 Subject: CID-202 Checker: REVERSE_INULL Function: LLScriptEventHandler::recurse(_iobuf *, int, int, e_lscript_compile_pass, e_lscript_prune_type, int &, LLScriptScope *, e_lscript_types &, e_lscript_types, unsigned long long &, LLScriptByteCodeChunk *, LLScriptByteCodeChunk *, int, LLScriptScopeEntry *, int, LLScriptLibData **) --- indra/lscript/lscript_compile/lscript_tree.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'indra/lscript/lscript_compile/lscript_tree.cpp') diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index 4ba41db2fc..2a9a858947 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -9805,21 +9805,22 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom break; case LSCP_EMIT_BYTE_CODE: { - // order for event handler - // set jump table value - S32 jumpoffset; - jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; - - integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); - - // 0 - 3: offset to actual data - S32 offsetoffset = chunk->mCurrentOffset; - S32 offsetdelta = 0; - chunk->addBytes(4); - // null terminated event name and null terminated parameters + llassert(mEventp); if (mEventp) { + // order for event handler + // set jump table value + S32 jumpoffset; + jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; + + integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); + + // 0 - 3: offset to actual data + S32 offsetoffset = chunk->mCurrentOffset; + S32 offsetdelta = 0; + chunk->addBytes(4); + LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE); mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL); chunk->addBytes(event->mCodeChunk, event->mCurrentOffset); -- cgit v1.2.3 From 45ea2bbd1e74be1d5158d3e38986f00cc53f0236 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:18:04 +0000 Subject: simpler fix for CID-202 --- indra/lscript/lscript_compile/lscript_tree.cpp | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'indra/lscript/lscript_compile/lscript_tree.cpp') diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index 2a9a858947..3d19de193a 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -9805,27 +9805,27 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom break; case LSCP_EMIT_BYTE_CODE: { - // null terminated event name and null terminated parameters llassert(mEventp); - if (mEventp) - { - // order for event handler - // set jump table value - S32 jumpoffset; - jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; - - integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); - - // 0 - 3: offset to actual data - S32 offsetoffset = chunk->mCurrentOffset; - S32 offsetdelta = 0; - chunk->addBytes(4); - - LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE); - mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL); - chunk->addBytes(event->mCodeChunk, event->mCurrentOffset); - delete event; - } + if (!mEventp) return; + + // order for event handler + // set jump table value + S32 jumpoffset; + jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; + + integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); + + // 0 - 3: offset to actual data + S32 offsetoffset = chunk->mCurrentOffset; + S32 offsetdelta = 0; + chunk->addBytes(4); + + // null terminated event name and null terminated parameters + LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE); + mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL); + chunk->addBytes(event->mCodeChunk, event->mCurrentOffset); + delete event; + chunk->addBytes(1); // now we're at the first opcode -- cgit v1.2.3