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

Dean Long dlong at openjdk.org
Sat Feb 3 00:15:06 UTC 2024


On Fri, 2 Feb 2024 09:47:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> See the details in the bug. I think current `ABS` implementation is beyond repair, and we should just switch to `uabs`.
>> 
>> Additional testing:
>>  - [x] Linux x86_64 fastdebug, `all` with `-ftrapv` (now fully passes!)
>>  - [x] Linux x86_64 fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Touchups

Another alternative, leave ABS as is, but have it check for invalid inputs, and again fix the callers that are passing values like MIN_VALUE.

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

PR Comment: https://git.openjdk.org/jdk/pull/17617#issuecomment-1924928081


More information about the graal-dev mailing list