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

Dean Long dlong at openjdk.org
Fri Apr 12 19:45:43 UTC 2024


On Fri, 12 Apr 2024 10:05:55 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:
> 
>  - More straightforward
>  - Richer error reporting

src/hotspot/share/utilities/globalDefinitions.hpp line 1119:

> 1117:   T res = (x > 0) ? x : -x;
> 1118: #ifdef ASSERT
> 1119:   if (res < 0) {

I don't see how we could ever hit this.  Checking input seems sufficient.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18751#discussion_r1563102819


More information about the hotspot-dev mailing list