Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #23827; Cyclic proc calls causes infinite memory usage in VM #23830

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
allows foreign functions having forward decls
  • Loading branch information
ringabout committed Jul 12, 2024
commit dd2edf4562c49f30de1ab39f40a2f7296e90dac4
3 changes: 2 additions & 1 deletion compiler/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 1559,8 @@ proc checkCanEval(c: PCtx; n: PNode) =
elif s.kind == skParam and s.typ.kind == tyTypeDesc: discard
else: cannotEval(c, n)
elif s.kind in {skProc, skFunc, skConverter, skMethod,
skIterator} and sfWasForwarded in s.flags:
skIterator} and sfWasForwarded in s.flags and
s.originatingModule == c.module: # forbides recursive calls from the same module
cannotEval(c, n)

template needsAdditionalCopy(n): untyped =
Expand Down