Skip to content

Conversation

@ringabout
Copy link
Member

@ringabout ringabout commented Oct 20, 2025

fixes #25008

It seems that semOverloadedCall evaluates the same node twice using tryConstExpr in order for efExplain to print all the diagnostic output. The problem is that tryConstExpr has side effects, i.e., it changes the slot index of variables after VM execution.

discard
of nkSym:
if n.sym.kind in {skVar, skLet} and sfGlobal notin n.sym.flags:
n.sym.position = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is position even used for? By the VM?

@Araq Araq merged commit 130eac2 into devel Oct 28, 2025
21 checks passed
@Araq Araq deleted the pr_heulen branch October 28, 2025 10:47
@github-actions
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 130eac2

Hint: mm: orc; opt: speed; options: -d:release
183207 lines; 8.276s; 661.73MiB peakmem

narimiran pushed a commit that referenced this pull request Oct 28, 2025
fixes #25008

It seems that `semOverloadedCall` evaluates the same node twice using
`tryConstExpr` in order for `efExplain` to print all the diagnostic
output. The problem is that `tryConstExpr` has side effects, i.e., it
changes the slot index of variables after VM execution.

(cherry picked from commit 130eac2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler internal error compiler/vmgen.nim(1771, 23) with static overload

3 participants