RFR: 8301858: Verification error when compiling switch with record patterns [v2]

Aggelos Biboudis abimpoudis at openjdk.org
Wed Feb 8 13:19:22 UTC 2023


> When unrolling/translating record patterns with an unconditional case, we were translating the last/innermost case to`case null, default` skipping the initialization of a bound variable `o` in the example below:
> 
>     switch (..) {
>       case R1(Object o):
>                       return meth_O(o); 
>     }
>     => 
>     switch (..) {
>        case R1: 
>           switch(..) {
>             case null, default:
>                             return meth_O(o);
>           }
>     }
> 
> This PR addresses that by emitting the correct label instead of default.

Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:

  Fix unrolling with cases that have null and unconditional
  
  Co-authored-by: Jan Lahoda <jan.lahoda at oracle.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/12438/files
  - new: https://git.openjdk.org/jdk/pull/12438/files/14f8cd9a..f9d51d99

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12438&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12438&range=00-01

  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/12438.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12438/head:pull/12438

PR: https://git.openjdk.org/jdk/pull/12438


More information about the compiler-dev mailing list