RFR: 8324858: [vectorapi] Bounds checking issues when accessing memory segments [v2]

Paul Sandoz psandoz at openjdk.org
Fri Feb 2 00:06:01 UTC 2024


On Thu, 1 Feb 2024 12:22:10 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> My expectation is the risk is small, but of course non-zero. These tests can be expensive to run so i was trying balance the risk without increasing test execution times.
>> 
>> I could strengthen the comment from:
>> 
>>         @ForceInline
>>         @Override final
>>         public ByteVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) {
>>             // User entry point:  Be careful with inputs.
>>             return ByteVector
>>                 .fromMemorySegment(this, ms, offset, bo);
>>         }
>> 
>> 
>> to:
>> 
>> 
>>         @ForceInline
>>         @Override final
>>         public ByteVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) {
>>             // User entry point
>>             // Defer only to the equivalent method on the vector class, using the same inputs
>>             return ByteVector
>>                 .fromMemorySegment(this, ms, offset, bo);
>>         }
>
> Sounds good

Done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17621#discussion_r1475344913


More information about the core-libs-dev mailing list