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

Vicente Romero vromero at openjdk.org
Thu Feb 9 15:51:33 UTC 2023


On Wed, 8 Feb 2023 14:29:10 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.
>
> Aggelos Biboudis has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   Fix unrolling with cases that have null and unconditional
>   
>   Co-authored-by: Jan Lahoda <jan.lahoda at oracle.com>

looks good

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

Marked as reviewed by vromero (Reviewer).

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


More information about the compiler-dev mailing list