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 #204: Consider string() as numeric constant when optimising switches #205

Merged
merged 1 commit into from Apr 17, 2021

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Apr 17, 2021

self.optimised is used as a replacement in the caller, but for complex expressions a return action is then created when parsing caller's results and this return action uses caller's scope instead callee's one, that was the first bug (fixed with 597685d).
So instead, now the original callee is rewritten like the return action (but with the correct scope) and string() was catch in the rewrite, causing their special handling as result values to be ignored.

string() return values are similar to numeric constant, they don't trigger the creation of a return action. So there's no need to rewrite switches for them.

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.

None yet

2 participants