Re: RFR: 8288534: Out of bound errors for memory segment access mentions wrong values [v2]

2022-06-16 Thread Paul Sandoz
On Thu, 16 Jun 2022 12:16:19 GMT, Maurizio Cimadamore wrote: >> While playing with the API, I've realized that some of the out of bound >> error messgaes come out incorrectly. >> >> This is because the bound check is performed as follows (to avoid overflow): >> >> >> Objects.checkIndex(offse

Re: RFR: 8288534: Out of bound errors for memory segment access mentions wrong values

2022-06-16 Thread Maurizio Cimadamore
On Wed, 15 Jun 2022 21:24:04 GMT, Maurizio Cimadamore wrote: > While playing with the API, I've realized that some of the out of bound error > messgaes come out incorrectly. > > This is because the bound check is performed as follows (to avoid overflow): > > > Objects.checkIndex(offset, this

Re: RFR: 8288534: Out of bound errors for memory segment access mentions wrong values [v2]

2022-06-16 Thread Maurizio Cimadamore
> While playing with the API, I've realized that some of the out of bound error > messgaes come out incorrectly. > > This is because the bound check is performed as follows (to avoid overflow): > > > Objects.checkIndex(offset, this.length - length + 1); > > > So, if out-of-bounds access is de

Re: RFR: 8288534: Out of bound errors for memory segment access mentions wrong values

2022-06-16 Thread Maurizio Cimadamore
On Wed, 15 Jun 2022 22:00:22 GMT, Paul Sandoz wrote: > I would expect passing an non-constant exception mapper should work. The C2 > intrinsic never accesses the exception mapper argument, and a range check > failure results in a deoptimzation back to the interpreter from which the > exception

Re: RFR: 8288534: Out of bound errors for memory segment access mentions wrong values

2022-06-15 Thread Paul Sandoz
On Wed, 15 Jun 2022 21:24:04 GMT, Maurizio Cimadamore wrote: > While playing with the API, I've realized that some of the out of bound error > messgaes come out incorrectly. > > This is because the bound check is performed as follows (to avoid overflow): > > > Objects.checkIndex(offset, this

RFR: 8288534: Out of bound errors for memory segment access mentions wrong values

2022-06-15 Thread Maurizio Cimadamore
While playing with the API, I've realized that some of the out of bound error messgaes come out incorrectly. This is because the bound check is performed as follows (to avoid overflow): Objects.checkIndex(offset, this.length - length + 1); So, if out-of-bounds access is detected, the resultin