[jdk19] RFR: 8289365: SegmentAllocator:allocateArray(MemoryLayout, count) does not throw IAEx when count is -1

Paul Sandoz psandoz at openjdk.org
Mon Jul 11 22:13:43 UTC 2022


On Mon, 11 Jul 2022 14:45:42 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> The default implementation for `SegmentAllocator:allocateArray(MemoryLayout, count)` is missing a check for negative array size.
> In the past this used to be caught in the `SequenceLayout` factory, but not anymore, as now `SequenceLayout` accepts `-1` as special size where the sequence element count is inferred. So, an explicit check is needed.

Marked as reviewed by psandoz (Reviewer).

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

PR: https://git.openjdk.org/jdk19/pull/132


More information about the core-libs-dev mailing list