-
Notifications
You must be signed in to change notification settings - Fork 248
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
Infinite loop
s crash the compiler
#7103
Comments
Perhaps it could also be handled similarly to #6292 |
SSA in general isn't really equipped to deal with alternate looping constructs. Not only do we assume every function has exactly one return, there are also assumptions on a loop's block structure in the loop unrolling pass (pre-header, header, body blocks). This block structure has been relaxed over time to return optionals but I wouldn't be surprised if that pass finds a block before the infinite loop which happens to start with a This is fixable though. I'd definitely be fine with erroring if the loop doesn't contain at least 1 break as well. Identifying whether the break is reachable or not correctly in all cases is impossible so we don't need to try especially for a first pass at this. We could add a warning/error later if the break is known unreachable though. We'll probably know this somewhere in SSA. |
Aim
This code:
Expected Behavior
Expected the code to compile and execute well.
Bug
It leads to a crash:
If we change the failing function to handle empty return values, then we must do more things:
Vec::new()
in that case.But even then the compiler crashes with this:
To Reproduce
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
No response
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: