RFR: 8313249: Fix -Wconversion warnings in verifier code [v4]

Dean Long dlong at openjdk.org
Mon Jul 31 19:55:46 UTC 2023


On Mon, 31 Jul 2023 19:42:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> 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>.

uintptr_t would be 32-bits on a 32-bit platform, right?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15056#discussion_r1279814309


More information about the hotspot-runtime-dev mailing list