Commit cffe1418 authored by twanvl's avatar twanvl

Fix error in vc9: don't index outside vector

parent abaeee68
...@@ -213,7 +213,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script) ...@@ -213,7 +213,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
} }
// create jump record // create jump record
Jump* jump = new Jump; Jump* jump = new Jump;
jump->target = &script.instructions[i.data]; jump->target = &script.instructions[0] + i.data; // note: operator[] triggers assertion (in msvc>=9) failure if i.data==instructions.size()
assert(jump->target >= instr); // jumps must be forward assert(jump->target >= instr); // jumps must be forward
jump->stack_top.assign(stack.begin() + stack_size, stack.end()); jump->stack_top.assign(stack.begin() + stack_size, stack.end());
getBindings(scope, jump->bindings); getBindings(scope, jump->bindings);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment