RFR: 8314258: checked_cast doesn't properly check some cases

Afshin Zafari azafari at openjdk.org
Thu Feb 5 11:45:50 UTC 2026


On Thu, 5 Feb 2026 00:03:20 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this addition of the `integer_cast` utility.
> 
> Details in first comment, to avoid email spamming from automatic messages.
> 
> Testing: mach5 tier1-5 with `checked_cast` for integral types changed to call
> the new `integer_cast`.  Addition of `integer_cast` includes gtests.

src/hotspot/share/utilities/integerCast.hpp line 39:

> 37: // for the To Type.  From and To must be integral types.  This is used by
> 38: // integer_cast to test for tautological conversions.
> 39: template<typename From, typename To,

The order of From and To parameters is not consistent with the rest of the other templates.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29582#discussion_r2768663767


More information about the hotspot-dev mailing list