quarkusio / gizmo

Apache License 2.0
52 stars 41 forks source link

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

Open mkouba opened 1 year ago

mkouba commented 1 year ago

Currently, the generated bytecode contains some garbage as described in https://github.com/quarkusio/quarkus/pull/36626#discussion_r1370141899.

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

Ladicek commented 1 year ago

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.