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.
This commit is contained in:
Jason Beetham
2020-10-26 04:06:18 -06:00
committed by GitHub
parent b2740f5c63
commit a87617956f

View File

@@ -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,