Skip to content

Commit ccdb80d

Browse files
committed
VirtualMachine: Fix repeat loop crash
* the register must be freed after it is read (not before)
1 parent e623e04 commit ccdb80d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/virtualmachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ unsigned int *VirtualMachine::run(unsigned int *pos, RunningScript *script)
152152
run(pos, script);
153153

154154
do_repeat_loop:
155-
FREE_REGS(1);
156155
loopCount = READ_LAST_REG()->toLong();
156+
FREE_REGS(1);
157157
if (loopCount <= 0) {
158158
loopEnd = pos;
159159
while (*loopEnd != OP_LOOP_END && *loopEnd != OP_HALT)

0 commit comments

Comments
 (0)