RFR: 8318127: align_up has potential overflow [v7]

Kim Barrett kbarrett at openjdk.org
Wed Oct 9 19:12:52 UTC 2024


On Wed, 9 Oct 2024 15:59:25 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 updated the pull request incrementally with one additional commit since the last revision:
> 
>   placed function within ifdef

test/hotspot/gtest/utilities/test_align.cpp line 228:

> 226:   test_fail_alignment<uint64_t, uint8_t>();
> 227: }
> 228: #endif // ASSERT

github is showing a warning icon here, like maybe there isn't a newline at the end of the last line?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20808#discussion_r1794078883


More information about the hotspot-dev mailing list