RFR: 8339192: Native annotation parsing code of deprecated annotations causes crash [v2]

David Holmes dholmes at openjdk.org
Tue Sep 17 05:51:04 UTC 2024


On Tue, 17 Sep 2024 05:17:12 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 1174:
> 
>> 1172:           if (cp->is_within_bounds(boolean_value_index) &&
>> 1173:               cp->tag_at(boolean_value_index).is_int() &&
>> 1174:               cp->int_at(boolean_value_index) == 1) {
> 
> Should we use `== 1` or `(... & 1) == 1` for boolean conversions?

This is pre-existing code. As far as I am aware we will always encode booleans as either 1 or 0 in a `CONSTANT_Integer` in the CP. The JVMS doesn't clearly specify this, except for boolean arrays, but it is what our tools do.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21030#discussion_r1762373565


More information about the hotspot-runtime-dev mailing list