RFR: 8287244: Add bound check in indexed memory access var handle [v2]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue May 24 18:06:55 UTC 2022
On Tue, 24 May 2022 18:00:46 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> The terms `x_1, x_2, ... x__n` are defined, but `x_0` is not.
>>
>> I think you can refer to the first index out of bounds as the exclusive upper bound of the range?
>
> Sorry i misread the text, we are talking about the same thing. I think it would be clearer to refer `x_i` being in the range of `0` (inclusive) and `b_i` (exclusive), otherwise an .... is thrown. That way in subsequent doc on other methods in matches with `B`, which is exclusive.
yes, but that seems to affect this statement:
`0 <= x_i <= b_i, where 0 <= i <= n`, or IndexOutOfBoundsException is thrown.
So we can replace with
0 <= x_i < b_i, where 1 <= i <= n`, or IndexOutOfBoundsException is thrown.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8868
More information about the core-libs-dev
mailing list