RFR: 8339192: Native annotation parsing code of deprecated annotations causes crash [v2]
David Holmes
dholmes at openjdk.org
Tue Sep 17 06:05:06 UTC 2024
On Tue, 17 Sep 2024 05:21:15 GMT, Chen Liang <liach at openjdk.org> wrote:
>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>>
>> MIN macro was Linux specific - need MIN2
>
> src/hotspot/share/classfile/classFileParser.cpp line 1204:
>
>> 1202: if (count == 1
>> 1203: && s_size == (index - index0) // match size
>> 1204: && s_tag_val == *(abase + tag_off)
>
> I see in previous lines that the count restriction on `@Contended` remains, and such a restriction is absent for `@Deprecated`. Intentional?
For `@Deprecated` it previously asserted if there were <= 2 members and we needed to remove that. By examining only the first two members we are implicitly allowing for there to be more, but we will ignore all members if the unexpected ones come first. For `@Contended` we simply ignore the "value" setting if there is more than one member. I guess I could check for `count >= 1` to allow the same level of leniency.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21030#discussion_r1762393455
More information about the hotspot-runtime-dev
mailing list