Skip to content

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Oct 8, 2025

fixes #25208

type Conf = object
  val: int

const defaultConf = Conf(val: 123)
static:
  var conf: Conf
  conf = defaultConf
# opcLdConst is now always valid. We produce the necessary copy in the
# assignments now:

A opcLdConst is generated for defaultConf in conf = defaultConf. According to the comment above, we need to handle the copy for assignments of opcLdConst

@ringabout ringabout marked this pull request as draft October 8, 2025 15:03
@ringabout ringabout marked this pull request as ready for review October 8, 2025 15:07
@ringabout ringabout changed the title fixes #25208; VM issue with globals and assignments fixes #25208; generates a copy for opcLdConst in the assignments Oct 8, 2025
@Araq Araq merged commit f009ea6 into devel Oct 16, 2025
21 checks passed
@Araq Araq deleted the pr_gib_auf branch October 16, 2025 16:22
Copy link
Contributor

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

Hint: mm: orc; opt: speed; options: -d:release
183167 lines; 8.527s; 661.699MiB peakmem

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.

VM issue with globals and assignments

2 participants