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.

(cherry picked from commit a87617956f)
This commit is contained in:
Jason Beetham
2020-10-26 04:06:18 -06:00
committed by narimiran
parent 76971596ad
commit fabbb7ea3e

View File

@@ -2086,6 +2086,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,