mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
Fix #17: change &instrs[pos] to &instrs[0]+pos to avoid debug assertions when pos=instrs.size()
This commit is contained in:
@@ -199,7 +199,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
|
|||||||
} else {
|
} else {
|
||||||
// backward jump: just follow it, someone else (I_LOOP) will make sure
|
// backward jump: just follow it, someone else (I_LOOP) will make sure
|
||||||
// we don't go into an infinite loop
|
// we don't go into an infinite loop
|
||||||
instr = &script.instructions[i.data];
|
instr = &script.instructions[0] + i.data;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
|
|||||||
} else {
|
} else {
|
||||||
// we have been through the body once already
|
// we have been through the body once already
|
||||||
stack.erase(stack.end() - 2); // remove iterator
|
stack.erase(stack.end() - 2); // remove iterator
|
||||||
instr = &script.instructions[i.data];
|
instr = &script.instructions[0] + i.data;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
|
|||||||
stack.push_back(key);
|
stack.push_back(key);
|
||||||
} else {
|
} else {
|
||||||
stack.erase(stack.end() - 2); // remove iterator
|
stack.erase(stack.end() - 2); // remove iterator
|
||||||
instr = &script.instructions[i.data];
|
instr = &script.instructions[0] + i.data;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user