RFR: 8301858: Verification error when compiling switch with record patterns

Vicente Romero vromero at openjdk.org
Mon Feb 6 17:43:52 UTC 2023


On Mon, 6 Feb 2023 13:06:30 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

> 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.

looks sensible

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

Marked as reviewed by vromero (Reviewer).

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


More information about the compiler-dev mailing list