RFR: JDK-8300069: Left shift of negative value in share/adlc/dict2.cpp
Andrew Haley
aph at openjdk.org
Fri Jan 13 10:43:11 UTC 2023
On Thu, 12 Jan 2023 18:48:46 GMT, Justin King <jcking at openjdk.org> wrote:
> Refactor `hashstr` to use unsigned integrals to avoid undefined behavior.
In general, we should be very careful about fixing problems revealed by UB sanitizer. Some are serious, such as null pointer dereferences, some aren't. But "fixing" an overflow by converting it to unsigned, silently wrapping around, isn't a fix at all.
Having said so, this is just a hash function. So this fix won't break anything, but I'm not convinced it's needed either.
-------------
PR: https://git.openjdk.org/jdk/pull/11977
More information about the hotspot-compiler-dev
mailing list