Integrated: 8301858: Verification error when compiling switch with record patterns
Aggelos Biboudis
abimpoudis at openjdk.org
Thu Feb 9 16:06:56 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.
This pull request has now been integrated.
Changeset: 3b05a94c
Author: Aggelos Biboudis <abimpoudis at openjdk.org>
Committer: Vicente Romero <vromero at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/3b05a94c36e5d54693694c2e9950eca42626962b
Stats: 17 lines in 2 files changed: 13 ins; 0 del; 4 mod
8301858: Verification error when compiling switch with record patterns
Reviewed-by: vromero
-------------
PR: https://git.openjdk.org/jdk/pull/12438
More information about the compiler-dev
mailing list