From 74230fefeb4f01f8097016db73fe851b7c8f865e Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Mon, 4 May 2020 13:22:44 +0200 Subject: [PATCH] Fix #17: change &instrs[pos] to &instrs[0]+pos to avoid debug assertions when pos=instrs.size() --- src/script/dependency.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script/dependency.cpp b/src/script/dependency.cpp index 60edc8f1..f03960d1 100644 --- a/src/script/dependency.cpp +++ b/src/script/dependency.cpp @@ -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; }