RFR JDK-8220018: javac crash when compiling try-catch-finally inside switch expression

Jan Lahoda jan.lahoda at oracle.com
Thu May 9 08:34:12 UTC 2019


Hi Bernard,

I apologize for late reply. Thanks for the patch, looks OK to me, but I 
guess it would be good to have another review on this.

Would it be possible to enhance the tests with the testcase below (and 
any other testcases needed)?

Thanks,
     Jan

On 27. 03. 19 19:20, B. Blaser wrote:
> Hi,
> 
> Please review the following fix for [1] which has already been
> discussed in the corresponding thread [2]:
> 
> http://cr.openjdk.java.net/~bsrbnd/jdk8220018/webrev.00/
> 
> It includes the variant I suggested to store the switch expression
> result in a single temporary variable along with Jan's solution for
> switch expressions used as conditions. Note that I had to do a tiny
> correction to the latter (see 'code.resolve(value.trueJumps)') to make
> the following example succeed:
> 
>      public static void test4() {
>          if (!switch (0) {
>              default -> {
>                  try {
>                      break switch(0) { default -> true; };
>                  }
>                  finally {
>                      break false;
>                  }
>              }
>          }) {
>              System.out.println("OK!");
>          }
>      }
> 
> It also includes Jan's test case.
> 
> Any feedback is welcome (tier1 is OK).
> 
> Thanks,
> Bernard
> 
> [1] https://bugs.openjdk.java.net/browse/JDK-8220018
> [2] http://mail.openjdk.java.net/pipermail/compiler-dev/2019-March/013073.html
> 


More information about the compiler-dev mailing list