On Tue, 4 Aug 2026 09:25:10 GMT, Per Minborg <[email protected]> wrote:

> This PR proposes to introduce checks for multiplication overflow in 
> `SequenceLayoutImpl`. 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/jdk/internal/foreign/layout/SequenceLayoutImpl.java 
line 135:

> 133:             } else {
> 134:                 try {
> 135:                     actualCount = Math.multiplyExact(elementCounts[i], 
> actualCount);

There's one check missing -- a bit later, if one of the counts was `-1` we 
infer one -- and then update actualCount again. Now, in principle that should 
not lead to issues (because inference is done so that the missing dimension is 
expected/actual -- but worth checking).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32191#discussion_r3711507185

Reply via email to