-
Notifications
You must be signed in to change notification settings - Fork 8
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
Function inlining does not work with guard clauses #70
Comments
This is no bug, it is just not implemented. |
The fix only works with return statements that return a value, empty return statements still have the same issue. |
This is quite troublesome, I think the best to handle this adding a new field on the function to stop when a return statement has been inlined. |
I just read the code, seems like you already did what I thought was best. I will investigate further. Do you have any clue why this behaviour occurs? |
Probably because there is no instruction to mark as an "always running" return, which reminds me that I made a mistake a while back because those jumps I called "reduntant" were really important on other circumstances, like an early return. So yeah, I'm gonna revert some of those changes and it should work again |
I noticed that function inlining doesn't work properly with code like this:
Produces:
While the expected output was:
The example source has repeated if comparisons to show that all of the return statements got inlined, which is
not expected and has extremely high potential to cause silent issues.
The text was updated successfully, but these errors were encountered: