RFR: 8364360: Defining hidden class with no room in constant pool crashes the VM [v6]

Kim Barrett kbarrett at openjdk.org
Fri Oct 31 20:27:02 UTC 2025


On Fri, 31 Oct 2025 19:30:06 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Doing a cast to u4 and an overflow check might be the best thing.  Then I won't need the assert.
>
> I made this change and reran the VM jck tests.

> Isn't this technically UB behavior? It isn't guaranteed that a u2 will overflow to a low value. It might be safer have cp_size be an int and then guarantee that cp_size < 65535.

[drive-by comment] Unsigned integer arithmetic is modular arithmetic. Overflow is not UB, it's wrap-around.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27964#discussion_r2482579619


More information about the hotspot-runtime-dev mailing list