RFR: 8339192: Native annotation parsing code of deprecated annotations causes crash [v2]
David Holmes
dholmes at openjdk.org
Tue Sep 17 08:51:06 UTC 2024
On Tue, 17 Sep 2024 05:59:58 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> 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.
I meant > 2 of course.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21030#discussion_r1762671944
More information about the hotspot-runtime-dev
mailing list