diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-13 14:18:04 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-13 14:18:04 +0000 |
commit | 45ea2bbd1e74be1d5158d3e38986f00cc53f0236 (patch) | |
tree | 555f3d7690c2e5dff6e9cf22ea28fce5c7b875e1 /indra/lscript | |
parent | fa69f09e685bbb4b3b6faac825fd5c9af7100be5 (diff) |
simpler fix for CID-202
Diffstat (limited to 'indra/lscript')
-rw-r--r-- | indra/lscript/lscript_compile/lscript_tree.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
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 |