diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-13 14:15:31 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-13 14:15:31 +0000 |
commit | fa69f09e685bbb4b3b6faac825fd5c9af7100be5 (patch) | |
tree | 7b0ca6ba735169d2913c98683b53e6195f1af6fe /indra/lscript | |
parent | eb1d043dafa86480757cc1ed934d96ba51033581 (diff) |
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 **)
Diffstat (limited to 'indra/lscript')
-rw-r--r-- | indra/lscript/lscript_compile/lscript_tree.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
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); |