RFR: 8318127: align_up has potential overflow
Dean Long
dlong at openjdk.org
Sat Sep 21 00:22:35 UTC 2024
On Mon, 2 Sep 2024 09:41:29 GMT, Casper Norrbin <duke 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.
Maybe we need two versions of this function, one that allows wrap-around and the other that doesn't. I'm guessing that for most callers, wrap-around would be unexpected and cause bugs, so let's have them ask for it explicitly.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20808#issuecomment-2364776411
More information about the hotspot-dev
mailing list