RFR: 8328934: Assert that ABS input and output are legal [v4]
Aleksey Shipilev
shade at openjdk.org
Mon Apr 15 07:59:08 UTC 2024
On Fri, 12 Apr 2024 19:43:20 GMT, Dean Long <dlong at openjdk.org> wrote:
>> 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.
I thought we would like to check for other (unknown) cases for ABS failures, since we would otherwise presume only the `ABS(min_int)` is problematic. But I can remove it, and we would add more cases later if we find them. See new commit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18751#discussion_r1565329121
More information about the hotspot-dev
mailing list