RFR: 8318127: align_up has potential overflow [v3]

Casper Norrbin cnorrbin at openjdk.org
Wed Oct 9 12:37:41 UTC 2024


On Tue, 1 Oct 2024 14:39:10 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

>> Hi everyone,
>> 
>> The `align_up` function contained code which could potentially overflow and produce an incorrect result. This PR adds an assert to check for such.
>> 
>> Additionally, two test case that previously caused an overflow have been updated to use the highest possible values that do not trigger an overflow.
>
> Casper Norrbin has refreshed the contents of this pull request, and previous commits have been removed. Incremental views are not available. The pull request now contains two commits:
> 
>  - change reserve_memory test
>  - align overflow check

I've added a few death tests that uses combinations of signed/unsigned and small/large integer types to check for overflow

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

PR Comment: https://git.openjdk.org/jdk/pull/20808#issuecomment-2402190260


More information about the hotspot-dev mailing list