RFR: 8324833: Signed integer overflows in ABS [v2]

Aleksey Shipilev shade at openjdk.org
Fri Feb 2 09:47:29 UTC 2024


On Thu, 1 Feb 2024 20:24:55 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Unnecessary comment
>
> src/hotspot/share/opto/ifnode.cpp line 1978:
> 
>> 1976:           // "x - y" -> must add one to the difference for number of elements in [x,y]
>> 1977:           const jlong diff = (jlong)MIN2(offset2, off_lo) - (jlong)MAX2(offset2, off_hi);
>> 1978:           if (uabs(diff) < maximum_number_of_min_max_interval_indices) {
> 
> unsigned vs signed comparison.  Maybe the rhs should be unsigned as well?

Yes, fixed in new commit.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17617#discussion_r1475807552


More information about the graal-dev mailing list