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

make distinct conversions addressable in VM #24124

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Sep 17, 2024

fixes #24097

For nkConv addresses where the conversion is between 2 types that are equal between backends, treat assignments the same as assignments to the argument of the conversion. In the VM this seems to be in genAsgn and genAsgnPatch, as evidenced by the special logic for nkDerefExpr etc.

This doesn't handle ranges after #24037 because sameBackendType is used and not sameBackendTypeIgnoreRange. This is so this is backportable without #24037 and another PR can be opened that implements it for ranges and adds tests as well. We can also merge sameBackendTypeIgnoreRange with sameBackendType since it doesn't seem like anything that uses it would be affected (only cycle checks and the VM), but then we still have to add tests.

@Araq Araq merged commit 1fbb67f into nim-lang:devel Sep 17, 2024
19 checks passed
Copy link
Contributor

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

Hint: mm: orc; opt: speed; options: -d:release
174432 lines; 8.159s; 654.336MiB 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.

Can't modify distinct addresses with conversions in VM
2 participants