Fix #17: change &instrs[pos] to &instrs[0]+pos to avoid debug assertions when pos=instrs.size()

This commit is contained in:
Twan van Laarhoven
2020-05-04 13:22:44 +02:00
parent 177cc25487
commit 74230fefeb
+3 -3
View File
@@ -199,7 +199,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
} else {
// backward jump: just follow it, someone else (I_LOOP) will make sure
// we don't go into an infinite loop
instr = &script.instructions[i.data];
instr = &script.instructions[0] + i.data;
}
break;
}
@@ -239,7 +239,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
} else {
// we have been through the body once already
stack.erase(stack.end() - 2); // remove iterator
instr = &script.instructions[i.data];
instr = &script.instructions[0] + i.data;
}
break;
}
@@ -254,7 +254,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
stack.push_back(key);
} else {
stack.erase(stack.end() - 2); // remove iterator
instr = &script.instructions[i.data];
instr = &script.instructions[0] + i.data;
}
break;
}