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

Henry Lin duke at openjdk.org
Mon Jul 22 21:16:07 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 incrementally with one additional commit since the last revision:

  formatting

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20164/files
  - new: https://git.openjdk.org/jdk/pull/20164/files/f2011961..9b798b37

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

  Stats: 2 lines in 2 files changed: 1 ins; 1 del; 0 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