File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ VirtualMachinePrivate::~VirtualMachinePrivate()
115115 delete regs;
116116}
117117
118- unsigned int *VirtualMachinePrivate::run (unsigned int *pos)
118+ unsigned int *VirtualMachinePrivate::run (unsigned int *pos, bool reset )
119119{
120120 static const void *dispatch_table[] = {
121121 nullptr ,
@@ -186,9 +186,11 @@ unsigned int *VirtualMachinePrivate::run(unsigned int *pos)
186186 unsigned int *loopStart;
187187 unsigned int *loopEnd;
188188 size_t loopCount;
189- atEnd = false ;
190- atomic = true ;
191- warp = false ;
189+ if (reset) {
190+ atEnd = false ;
191+ atomic = true ;
192+ warp = false ;
193+ }
192194 DISPATCH ();
193195
194196do_halt:
@@ -279,7 +281,7 @@ do_repeat_loop_index1 : {
279281}
280282
281283do_until_loop:
282- loopStart = run (pos);
284+ loopStart = run (pos, false );
283285 if (!READ_LAST_REG ()->toBool ()) {
284286 Loop l;
285287 l.isRepeatLoop = false ;
@@ -314,7 +316,7 @@ do_loop_end : {
314316 engine->breakFrame ();
315317 return pos - 1 ;
316318 }
317- loopStart = run (l.start );
319+ loopStart = run (l.start , false );
318320 if (!READ_LAST_REG ()->toBool ())
319321 pos = loopStart;
320322 else
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ struct VirtualMachinePrivate
2222 VirtualMachinePrivate (const VirtualMachinePrivate &) = delete ;
2323 ~VirtualMachinePrivate ();
2424
25- unsigned int *run (unsigned int *pos);
25+ unsigned int *run (unsigned int *pos, bool reset = true );
2626
2727 static const unsigned int instruction_arg_count[];
2828
You can’t perform that action at this time.
0 commit comments