RFR: 8344026: Ubsan: prevent potential integer overflow in c1_LIRGenerator_<arch>.cpp file [v8]

Tobias Hartmann thartmann at openjdk.org
Wed Dec 11 12:07:41 UTC 2024


On Wed, 11 Dec 2024 09:34:53 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> Is this just undefined behaviour, but no compiler so far actually does something unexpected? If so, it will be impossible to have a failing regression test before the patch. But if there is actually an overflow bug, then there could be a regression test that would be failing before the patch, and we should try to find it.
>
>> Is this just undefined behaviour, but no compiler so far actually does something unexpected?
> 
> Exactly. The compilers already seem to generate code which matches the unsigned behavior. Only UBSan checks found the issue. They run into the issue with existing tests which are passing when UBSan is disabled. Overflow doesn't cause errors when using "wrap around" behavior which matches the Java integer arithmetic semantics.

Okay, thanks for the clarification!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22144#discussion_r1880079685


More information about the hotspot-compiler-dev mailing list