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

pass0: fix the pass crashing for CheckedCallAsgn #84

Merged
merged 5 commits into from
Dec 15, 2024

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Dec 12, 2024

Summary

Fix two bugs that caused to CheckedCallAsgn to never work, with its
presence always resulting in an assertion triggering.

Details

  • the callee being at a non-zero child node index wasn't considered
  • the target local was fetched from the wrong child node

A test is added for each possible checked call variation (with/without
assignment, indirect/direct). To match the naming scheme of the new
tests, the existing t03_checked_void_call.test test is renamed to
t03_checked_call.test.


Notes For Reviewers

  • the bug was discovered with the help of skully

It was not taken into account that the callee isn't always at child
index 0 (such as in the case of `CheckedCallAsgn`).
The wrong node was accessed for fetching the destination local.
@zerbina zerbina added the bug Something isn't working label Dec 12, 2024
@zerbina zerbina merged commit 95ffeda into nim-works:main Dec 15, 2024
5 checks passed
@zerbina zerbina deleted the pass0-fix-call-translation-bugs branch December 15, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant