summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_compile/lscript_bytecode.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-07-30 19:15:46 -0700
committerRichard Linden <none@none>2013-07-30 19:15:46 -0700
commit5762c1d0d727f0050aefe7126ab2d5280bebfb9b (patch)
tree78bdcc931460dfc45d35cd1707ddf1afdf049a2e /indra/lscript/lscript_compile/lscript_bytecode.cpp
parent4cca9ba279f908f206fa5e32adccf1038f05cc7f (diff)
parent910874a7e32bdfc456474e2d0ee84d190be3011e (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/lscript/lscript_compile/lscript_bytecode.cpp')
-rwxr-xr-xindra/lscript/lscript_compile/lscript_bytecode.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/indra/lscript/lscript_compile/lscript_bytecode.cpp b/indra/lscript/lscript_compile/lscript_bytecode.cpp
index 95b2f35a94..b6c3dd3a86 100755
--- a/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -40,8 +40,8 @@ LLScriptJumpTable::LLScriptJumpTable()
LLScriptJumpTable::~LLScriptJumpTable()
{
- mLabelMap.deleteAllData();
- mJumpMap.deleteAllData();
+ delete_and_clear(mLabelMap);
+ delete_and_clear(mJumpMap);
}
void LLScriptJumpTable::addLabel(char *name, S32 offset)
@@ -203,17 +203,14 @@ void LLScriptByteCodeChunk::addJump(char *name)
void LLScriptByteCodeChunk::connectJumps()
{
- char *jump;
- S32 offset, jumppos;
-
if (mJumpTable)
{
- for (jump = mJumpTable->mJumpMap.getFirstKey();
- jump;
- jump = mJumpTable->mJumpMap.getNextKey())
+ for(std::map<char *, S32 *>::iterator it = mJumpTable->mJumpMap.begin(), end_it = mJumpTable->mJumpMap.end();
+ it != end_it;
+ ++it)
{
- jumppos = *mJumpTable->mJumpMap[jump];
- offset = *mJumpTable->mLabelMap[jump] - jumppos;
+ S32 jumppos = *it->second;
+ S32 offset = *mJumpTable->mLabelMap[it->first] - jumppos;
jumppos = jumppos - 4;
integer2bytestream(mCodeChunk, jumppos, offset);
}