[foreign-memaccess+abi] RFR: 8266371: Memory segment bound check fails because of small segment optimizations

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Apr 30 14:24:22 UTC 2021


The optimization for small memory segment bound check does not take into account numeric overflow. As a result, the bounds check does not detect big long values which, when casted back to int values appear to be within the segment's bounds.

The fix is to avoid the optimized bound check routine if the offset/length at which the segment is accessed is bigger than Integer.MAX_VALUE.

Benchmarks do not seem affected by this change (I'll post results in a separate comment).

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

Commit messages:
 - Initial push

Changes: https://git.openjdk.java.net/panama-foreign/pull/524/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=524&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8266371
  Stats: 14 lines in 3 files changed: 8 ins; 5 del; 1 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/524.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/524/head:pull/524

PR: https://git.openjdk.java.net/panama-foreign/pull/524


More information about the panama-dev mailing list