RFR: JDK-8300069: Left shift of negative value in share/adlc/dict2.cpp

Andrew Haley aph at openjdk.org
Fri Jan 13 10:39: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.

> GCC 12.2.0 Linux 5.9.11 x86_64
> 
> Patch #11975 on-top of master (if it's not merged yet), configure with `--enable-ubsan`, and `make`. It should fail at the ADLC gensrc step.

Better not to make this change. Left shifting negative numbers is well defined on the platforms we use AFAIK, and this is really a bug in the C/C++ standards

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3367.html#1457

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

PR: https://git.openjdk.org/jdk/pull/11977


More information about the hotspot-compiler-dev mailing list