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

Fix GenC tail rec elimination for unit functions when body is not in Block #1640

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zhekai-jiang
Copy link
Contributor

This is to fix a newly-discovered subtle bug, following #1626. Essentially for Unit functions without a return statement, we add a return statement at the end so that it is not rewritten into an infinite while loop. We assumed before that all functions have body wrapped in a Block object, but actually this may not be the case.

(Interestingly, we didn’t change any test case, and it was not an issue on our x86/64 laptops and on CI (function bodies were always wrapped in Blocks). But I accidentally got an issue when I was testing things on a different Mac with Apple Silicon (ARM architecture), where sometimes if the function has, say, only an If statement, the body will simply be that If object instead of that If wrapped inside a Block object.)

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.

1 participant