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

Improve generated bytecode for Switch constructs with fall through disabled if the case block returns a value #164

Open
mkouba opened this issue Oct 24, 2023 · 1 comment

Comments

@mkouba
Copy link
Contributor

mkouba commented Oct 24, 2023

Currently, the generated bytecode contains some garbage as described in quarkusio/quarkus#36626 (comment).

We could try to detect that the case block ends with a return operation and do not break the scope.

@mkouba mkouba changed the title Fix generated bytecode for Switch constructs with fall through enabled if the case block returns a value Fix generated bytecode for Switch constructs with fall through disabled if the case block returns a value Oct 24, 2023
@Ladicek Ladicek changed the title Fix generated bytecode for Switch constructs with fall through disabled if the case block returns a value Improve generated bytecode for Switch constructs with fall through disabled if the case block returns a value Oct 24, 2023
@Ladicek
Copy link
Contributor

Ladicek commented Oct 24, 2023

This is a very naive approach (javac seems to do a much more involved control flow analysis), but it should be good enough for a decent number of cases, so +1.

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

No branches or pull requests

2 participants