RFR: 8271254: javac generates unreachable code when using empty semicolon statement

Guoxiong Li gli at openjdk.java.net
Mon Sep 13 15:36:10 UTC 2021


Hi all,

The method `Gen#genTry` is used by `visitTry` and `visitSynchronized`, but `genTry` can't identify who is invoking it so that it can't solve the concrete issues about try statement or synchronized statement separately. This patch adds a new parameter `actualTry` to identify the concrete situation( try or synchronized) and fixes this issue about using empty skip statement in the try statement body. And some related test cases are added.

Thanks for taking the time to review.

Best Regards,
-- Guoxiong

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

Commit messages:
 - Revise copyright
 - Fix test.
 - 8271254: javac generates unreachable code when using empty semicolon statement

Changes: https://git.openjdk.java.net/jdk/pull/5495/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5495&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8271254
  Stats: 104 lines in 2 files changed: 92 ins; 0 del; 12 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5495.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5495/head:pull/5495

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


More information about the compiler-dev mailing list