RFR: 8276836: Error in javac caused by switch expression without result expressions: Internal error: stack sim error

Guoxiong Li gli at openjdk.java.net
Tue Nov 23 06:30:08 UTC 2021


On Thu, 11 Nov 2021 13:47:17 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> The method `Gen#visitSwitchExpression` would switch code generation off by using the method `Code#markDead` when it meets the code like `throw new RuntimeException()`. Then the method `Gen#completeBinop` won't generate the expected code and wiil let the left operand stay in the stack without handling it.
> 
> This patch pops the left operand from the stack to solve this issue. And the corresponding test is added.
> 
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

Ping for review.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6350


More information about the compiler-dev mailing list