RFR: 8318127: align_up has potential overflow

Andrew Haley aph at openjdk.org
Mon Sep 23 11:22:36 UTC 2024


On Sun, 22 Sep 2024 11:02:57 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> There's no "perhaps" about the intended meaning in the JBS issue. I wrote that issue; I remember what I meant. 

Sorry, I didn't mean to suggest otherwise. I was quibbling about the "mathematical result", but it's not important.

> :) I suppose I could have been more precise.
> 
> So I disagree. I think align_up has an implied post-condition that the result is not less than the value being aligned. That's certainly how it's used, in every occurrance I've looked at. (I admit I didn't look at all ~450 uses though.)

It seems we have a genuine difference of opinion about what the user can reasonably expect. I'd expect modular arithmetic, because C++ says so. However, I'll withdraw my objection, if only for the sake of not spending too much time discussing this issue.

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

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


More information about the hotspot-dev mailing list