RFR: 8317132: Prepare HotSpot for permissive- [v5]
Jorn Vernee
jvernee at openjdk.org
Mon Oct 2 14:38:10 UTC 2023
On Mon, 2 Oct 2023 14:06:44 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> Okay. TBH, I don't see how this is an improvement over the status quo, since the `goto` still jumps over the initialization...
>
> The little gotcha in there is that goto is allowed to jump over the declaration of a scalar (of primitive type) local, but not the definition of one (declaration + initialization together). Hence goto is not allowed to jump over address pc = x; for instance, but is allowed to for address pc; pc = x;
Right, so we're employing a workaround to silence the warning. That seems like the tail wagging the dog though.
There's a potential issue in this code that the warning tries to point out: the code after the label might access the uninitialized variables, since they are in scope. Re-writing the code in the way you did makes the warning go away, but not the potential issue?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15955#discussion_r1342776049
More information about the hotspot-runtime-dev
mailing list