diff options
Diffstat (limited to 'indra/lscript/lscript_compile')
-rw-r--r-- | indra/lscript/lscript_compile/lscript_tree.cpp | 17 | ||||
-rw-r--r-- | indra/lscript/lscript_compile/lscript_tree.h | 4 |
2 files changed, 12 insertions, 9 deletions
diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index 3b8bbbe805..3d19de193a 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -9805,6 +9805,9 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom break; case LSCP_EMIT_BYTE_CODE: { + llassert(mEventp); + if (!mEventp) return; + // order for event handler // set jump table value S32 jumpoffset; @@ -9818,13 +9821,11 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom chunk->addBytes(4); // null terminated event name and null terminated parameters - if (mEventp) - { - 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; - } + 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 @@ -10626,6 +10627,8 @@ LLScriptScript::LLScriptScript(LLScritpGlobalStorage *globals, } temp = temp->mNextp; } + + mClassName[0] = '\0'; } void LLScriptScript::setBytecodeDest(const char* dst_filename) diff --git a/indra/lscript/lscript_compile/lscript_tree.h b/indra/lscript/lscript_compile/lscript_tree.h index a667e1eb5b..7de9606dfc 100644 --- a/indra/lscript/lscript_compile/lscript_tree.h +++ b/indra/lscript/lscript_compile/lscript_tree.h @@ -1876,7 +1876,7 @@ class LLScriptStateChange : public LLScriptStatement { public: LLScriptStateChange(S32 line, S32 col, LLScriptIdentifier *identifier) - : LLScriptStatement(line, col, LSSMT_STATE_CHANGE), mIdentifier(identifier) + : LLScriptStatement(line, col, LSSMT_STATE_CHANGE), mIdentifier(identifier), mReturnType(LST_NULL) { } @@ -2210,7 +2210,7 @@ class LLScriptState : public LLScriptFilePosition { public: LLScriptState(S32 line, S32 col, LSCRIPTStateType type, LLScriptIdentifier *identifier, LLScriptEventHandler *event) - : LLScriptFilePosition(line, col), mType(type), mIdentifier(identifier), mEvent(event), mNextp(NULL) + : LLScriptFilePosition(line, col), mType(type), mIdentifier(identifier), mEvent(event), mNextp(NULL), mStateScope(NULL) { } |