RFR: 8365163: [ubsan] left-shift issue in globalDefinitions.hpp [v2]
Kim Barrett
kbarrett at openjdk.org
Fri Aug 22 12:36:55 UTC 2025
On Fri, 22 Aug 2025 07:42:29 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
>> There was a left-shift of negative value UB in `set_high` function where the high value sign bit is on and is left-shifted 32 bits to put it in high word of the destination address.
>> To address it, first the left 32 bits of the provided `high` arg is cleared and then left-shifted 32 bits.
>>
>> Tests:
>> mach5 tiers 1-5 {macosx-aarch64, linux-x64, windows-x64} x {debug, product}
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>
> set high and low removed.
src/hotspot/share/utilities/globalDefinitions.hpp line 644:
> 642: inline jint high(jlong value) { return jint(value >> 32); }
> 643:
> 644: inline jlong jlong_from(jint h, jint l) {
pre-existing: I didn't find any tests of this function.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26809#discussion_r2293610645
More information about the hotspot-dev
mailing list