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 #23759; rework move for refc #23764

Merged
merged 4 commits into from
Jun 29, 2024
Merged

fixes #23759; rework move for refc #23764

merged 4 commits into from
Jun 29, 2024

Conversation

ringabout
Copy link
Member

fixes #23759

compiler/ccgexprs.nim Outdated Show resolved Hide resolved
@ringabout ringabout marked this pull request as ready for review June 27, 2024 14:54
@Araq
Copy link
Member

Araq commented Jun 27, 2024

This is not good enough, yet:

proc p(x: sink string) = 
  var y = move(x)
  assert x.len == 0

genAssignment(p, d, tmp, {})
resetLoc(p, tmp)
else:
genAssignment(p, d, a, {})
resetLoc(p, a)
Copy link
Member

Choose a reason for hiding this comment

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

If you always reset a then you mutate const data, potentially. What you need to do is to shadow the sink parameter with a variable of the same name.

@Araq Araq merged commit 56ed4e0 into devel Jun 29, 2024
18 checks passed
@Araq Araq deleted the pr_move_table branch June 29, 2024 08:43
Copy link
Contributor

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

Hint: mm: orc; opt: speed; options: -d:release
179028 lines; 8.365s; 664.703MiB peakmem

narimiran pushed a commit that referenced this pull request Jun 29, 2024
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.

move(table) does not move the table
2 participants