RFR: 8372635: Lambdas do not copy over SYNTHETIC flag for local variables
Vicente Romero
vromero at openjdk.org
Wed Dec 10 16:33:25 UTC 2025
On Wed, 10 Dec 2025 14:54:59 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Hi, I was the one who found this bug and filed it via @sciwhiz12 on the issue tracker.
>>
>> I was a bit confused by these flags, and didn't dig deep enough, but I'm not overly sure why these aren't just preserved as-is. Considering these are all Javac internal flags, my knowledge here is limited.
>>
>> Are there any flags applicable to locals that shouldn't be copied when lowering lambdas?
>
> The `& FINAL` mask seems to be originally from [JDK-8026749](https://bugs.openjdk.org/browse/JDK-8026749) ([commit](https://github.com/openjdk/jdk/commit/cf30c203379008ebae37bf00f1839a69cd53ca26)). That patch just aimed to create an LVT for debugger and did not copy over any flag, and incorrectly set the final flag which was subsequently fixed.
>
> I don't know why the original patch did not pass over all flags. Maybe it was limited to debugger support and never anticipated actual use of these variables' flags. Yet I don't see a reason in the original issue for not reusing the flags.
yep I originally misread the code. I'm also wondering now why we didn't pass all the original flags to the new symbol. We should probably check what breaks if all the flags are just passed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28724#discussion_r2607365429
More information about the compiler-dev
mailing list