[foreign-memaccess+abi] RFR: 8266371: Memory segment bound check fails because of small segment optimizations [v2]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Fri Apr 30 14:51:20 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).
Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
Address negative overflow as well
-------------
Changes:
- all: https://git.openjdk.java.net/panama-foreign/pull/524/files
- new: https://git.openjdk.java.net/panama-foreign/pull/524/files/2cbf6f5e..6f9d3754
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=524&range=01
- incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=524&range=00-01
Stats: 11 lines in 2 files changed: 9 ins; 0 del; 2 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