RFR: JDK-8255544: Create a checked cast
Andrew Haley
aph at redhat.com
Sat Oct 31 10:42:04 UTC 2020
On 31/10/2020 03:17, Ioi Lam wrote:
> On Wed, 28 Oct 2020 15:50:52 GMT, Andrew Haley <aph at openjdk.org> wrote:
>
>> In many places we've added C-style casts to silence compiler warnings, for example when truncating a size_t to an int when we know the size_t is a small struct. Such casts are inherently risky, because they effectively disable useful compiler warnings. We should add a form of cast that checks at runtime that a truncation does not overflow.
>
> Can we change one place in HotSpot to use this function (preferably in a frequently-used code path), to verity that it really works?
Oh, sure. I have plenty in the AArch64 back end, but I'll look for some
others.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-dev
mailing list