RFR: 8313249: Fix -Wconversion warnings in verifier code [v4]
Coleen Phillimore
coleenp at openjdk.org
Mon Jul 31 19:44:45 UTC 2023
On Mon, 31 Jul 2023 18:49:52 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add another static_cast
>
> src/hotspot/share/classfile/verificationType.hpp line 165:
>
>> 163: return VerificationType((uintptr_t)sh);
>> 164: }
>> 165: static VerificationType uninitialized_type(int bci)
>
> I'd rather have the caller make sure this is a u2. If we use int here then we need to make sure the shift below doesn't overflow.
VerificationType's constructor is uintptr_t so int << 8 shouldn't overflow, should it? Although it might change sign, which we don't warn about. I'll change it and make its caller (bci's are passed and used as int everywhere even though they're u2), does a checked_cast<u2>.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15056#discussion_r1279804982
More information about the hotspot-runtime-dev
mailing list