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

Shaojin Wen swen at openjdk.org
Thu Jan 30 15:59:54 UTC 2025


On Thu, 14 Nov 2024 05:32:34 GMT, Shaojin Wen <swen at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: fdfb68c8
Author:    Shaojin Wen <swen at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/fdfb68c8d0fddfe527291a7f4b75176c830dbb49
Stats:     164 lines in 53 files changed: 10 ins; 0 del; 154 mod

8344168: Change Unsafe base offset from int to long

Reviewed-by: liach

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

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


More information about the core-libs-dev mailing list