You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -233,10 +234,19 @@ unsigned int *VirtualMachinePrivate::run(unsigned int *pos, bool reset)
233
234
warp = oldState.second;
234
235
callTree.pop_back();
235
236
procedureArgTree.pop_back();
237
+
236
238
if (procedureArgTree.empty())
237
239
procedureArgs = nullptr;
238
240
else
239
241
procedureArgs = &procedureArgTree.back();
242
+
243
+
int loopsToRemove = loops.size() - loopCountTree.back();
244
+
assert(loopsToRemove >= 0);
245
+
loopCountTree.pop_back();
246
+
247
+
for (int i = 0; i < loopsToRemove; i++)
248
+
loops.pop_back();
249
+
240
250
DISPATCH();
241
251
}
242
252
@@ -781,6 +791,14 @@ unsigned int *VirtualMachinePrivate::run(unsigned int *pos, bool reset)
781
791
DISPATCH(); // this avoids freeing registers after "stopping" a warp script
782
792
}
783
793
FREE_REGS(ret);
794
+
795
+
if (atEnd) {
796
+
if (regCount > 0)
797
+
std::cout << "warning: VM: " << regCount << " registers were leaked by the script; this is most likely a bug in the VM or in the compiler" << std::endl;
798
+
799
+
return pos;
800
+
}
801
+
784
802
DISPATCH();
785
803
}
786
804
@@ -799,6 +817,7 @@ unsigned int *VirtualMachinePrivate::run(unsigned int *pos, bool reset)
0 commit comments