RFR: 8313554: Fix -Wconversion warnings for ResolvedFieldEntry
Dean Long
dlong at openjdk.org
Thu Aug 3 09:07:29 UTC 2023
On Wed, 2 Aug 2023 19:15:24 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
> The recent change in [JDK-8301996](https://bugs.openjdk.org/browse/JDK-8301996) added more -Wconversion warnings that are addressed in this patch. The aforementioned change has overlooked inconsistencies with the types used by `ResolvedFieldEntry` and the method `fill_in()`. Verified with tier 1-4 tests.
src/hotspot/share/interpreter/rewriter.cpp line 192:
> 190: int field_entry_index = Bytes::get_native_u2(p);
> 191: int pool_index = _initialized_field_entries.at(field_entry_index).constant_pool_index();
> 192: Bytes::put_Java_u2(p, (u2)pool_index);
I guess this isn't using checked_cast because similar code elsewhere in this file uses this style, but it means we can silently do the wrong thing. Is there a separate RFE to remove as many of these unchecked casts as possible?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15126#discussion_r1282886338
More information about the build-dev
mailing list