RFR: 8311077: Fix -Wconversion warnings in jvmti code [v4]

Coleen Phillimore coleenp at openjdk.org
Fri Jun 30 13:10:19 UTC 2023


On Fri, 30 Jun 2023 02:11:11 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> I had to change these two lines because BytecodeStream::get_index_u2 returns an int, so got the warning and this didn't need to be declared with u2.  get_index_u2() could be fixed to return a u2 but I didn't want to go that far as no casts were involved in this change.
>
> I think this change looks "wrong" - the indices are supposed to be u2's, if the function returns an int that seems an error.

Fixing these functions will have fallout further down in the code, so I didn't want to do this.  These functions are used in a lot of places in the code where int is used for convenience.  int is a convenient type.  This didn't require a cast because the function klass_at_noresolve()'s parameter is an int.  This isn't wrong.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14710#discussion_r1247802199


More information about the hotspot-dev mailing list