[jdk20u] Integrated: 8301858: Verification error when compiling switch with record patterns
Jan Lahoda
jlahoda at openjdk.org
Mon Feb 27 09:45:15 UTC 2023
On Mon, 20 Feb 2023 08:28:14 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> Original PR:
> https://github.com/openjdk/jdk/pull/12438
>
> Description from the original PR:
> 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: cc33209f
Author: Jan Lahoda <jlahoda at openjdk.org>
URL: https://git.openjdk.org/jdk20u/commit/cc33209f3f07544ce592e73789498bff0e2afa36
Stats: 17 lines in 2 files changed: 13 ins; 0 del; 4 mod
8301858: Verification error when compiling switch with record patterns
Backport-of: 3b05a94c36e5d54693694c2e9950eca42626962b
-------------
PR: https://git.openjdk.org/jdk20u/pull/6
More information about the jdk-updates-dev
mailing list