RFR: 8332697: ubsan: shenandoahSimpleBitMap.inline.hpp:68:23: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long int' [v2]

Henry Lin duke at openjdk.org
Mon Jul 22 18:57:00 UTC 2024


> Cast the result of `nth_bit(n)` to `uintptr_t` to prevent signed integer overflow error reported by `ubsan`. Unsigned overflow is not undefined behavior and is not checked by `ubsan`.

Henry Lin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'openjdk:master' into 833269790-overflow
 - 8332697: fix ubsan:shenandoahSimpleBitMap.inline.hpp runtime integer overflow

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20164/files
  - new: https://git.openjdk.org/jdk/pull/20164/files/ed2797fe..75d921cc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20164&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20164&range=00-01

  Stats: 6383 lines in 291 files changed: 4501 ins; 914 del; 968 mod
  Patch: https://git.openjdk.org/jdk/pull/20164.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20164/head:pull/20164

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


More information about the hotspot-dev mailing list