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

Ioi Lam iklam at openjdk.org
Fri Jul 28 23:17:50 UTC 2023


On Fri, 28 Jul 2023 21:28:16 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/classfile/stackMapTableFormat.hpp line 552:
>> 
>>> 550:   static u1 appends_to_frame_type(int appends) {
>>> 551:     assert(appends > 0 && appends < 4, "Invalid append amount");
>>> 552:     return (u1)(251 + appends);
>> 
>> This should use `checked_cast<u1>`
>
> This one clearly is < u1 since it checks the value for appends.

I would use static_cast to be consistent with `chops_to_frame_type`. That way the reader of this code has less metal exercise to do.

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

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


More information about the hotspot-runtime-dev mailing list