summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJason Beetham <beefers331@gmail.com>2020-10-26 04:06:18 -0600
committerGitHub <noreply@github.com>2020-10-26 11:06:18 +0100
commita87617956f9a521eac3663df6a6a9862bc7ae87e (patch)
tree2c8e2010e341a8d6fa279ca0e293323a6017732e
parentb2740f5c63088c0f0f723086c1742dd057355bf6 (diff)
downloadNim-a87617956f9a521eac3663df6a6a9862bc7ae87e.tar.gz
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.
-rw-r--r--compiler/vm.nim1
1 files changed, 1 insertions, 0 deletions
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,