RFR: 8344168: Change Unsafe base offset from int to long

Shaojin Wen swen at openjdk.org
Thu Nov 14 05:47:12 UTC 2024


The type of the Unsafe base offset constant is int, which may cause overflow when adding int offsets, such as 8343925 (PR #22012). 8343984 (PR #22027) fixes most of the offset overflows in JDK, but ArraysSupport and CRC32C are still unfixed.

@liach proposed the idea of ​​changing the Unsafe base offset to long, which is a complete solution to the Unsafe offset overflow. After discussing with @liach, I submitted this PR to implement @liach's idea.

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

Commit messages:
 - long Unsafe offset

Changes: https://git.openjdk.org/jdk/pull/22095/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22095&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8344168
  Stats: 70 lines in 21 files changed: 0 ins; 0 del; 70 mod
  Patch: https://git.openjdk.org/jdk/pull/22095.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22095/head:pull/22095

PR: https://git.openjdk.org/jdk/pull/22095


More information about the core-libs-dev mailing list