RFR: 8328934: Assert that ABS input and output are legal [v5]

Dean Long dlong at openjdk.org
Mon Apr 15 20:00:01 UTC 2024


On Mon, 15 Apr 2024 07:59:07 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> This should protect us from future accidents around `abs` misuse. We have fixed a few separately. I plan to use this as the litmus test in update releases to detect missing backports for actual fixes. I am running more tests to see if we have any other sightings in current codebase, but this can be reviewed for sanity meanwhile.
>> 
>> Additional testing:
>>  - [x] MacOS AArch64 server fastdebug build passes
>>  - [ ] Linux x86_64 server fastdebug, `all`
>>  - [ ] Linux x86_64 server fastdebug, 100K Fuzzer tests
>>  - [ ] Linux x86_64 server fastdebug, Maven CTW
>>  - [ ] Linux AArch64 server fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Also tests
>  - Drop the other check; dodge UB

There's probably a way to use std::enable_if here so the floating-point version has no checks, but I assume it's not needed because the C++ compiler optimizes out the check.

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

Marked as reviewed by dlong (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18751#pullrequestreview-2002039657


More information about the hotspot-dev mailing list