From a87617956f9a521eac3663df6a6a9862bc7ae87e Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Mon, 26 Oct 2020 04:06:18 -0600 Subject: [PATCH] Fixed iteration limit hit from execproc (#15723) [backport:1.2] [backport:1.4] When calling procs from Nim in Nimscript you could hit the VM iteration limit even though the code is functioning properly. This resolves that by making the iteration limit reset eachtime you call a proc. --- compiler/vm.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/vm.nim b/compiler/vm.nim index 185975ec3..ac2feac26 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -2078,6 +2078,7 @@ proc execute(c: PCtx, start: int): PNode = result = rawExecute(c, start, tos).regToNode proc execProc*(c: PCtx; sym: PSym; args: openArray[PNode]): PNode = + c.loopIterations = c.config.maxLoopIterationsVM if sym.kind in routineKinds: if sym.typ.len-1 != args.len: localError(c.config, sym.info,