[jdk21u-dev] RFR: 8341178: TypeRawPtr::add_offset may be "miscompiled" due to UB

Satyen Subramaniam ssubramaniam at openjdk.org
Mon Aug 11 19:48:50 UTC 2025


Backporting JDK-8341178: TypeRawPtr::add_offset may be "miscompiled" due to UB. Change catches case where compiler infers things based on prior pointer arithmetic not invoking UB. Fix preserves intended functionality by changing to integral arithmetic, adds over/underflow, and bit of cleanup. Ran GHA Sanity Checks, local tier 1 and 2. Patch is clean.

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

Commit messages:
 - Backport 0a57fe1df6f3431cfb2d5d868597c61ef6af3806

Changes: https://git.openjdk.org/jdk21u-dev/pull/2075/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=2075&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8341178
  Stats: 15 lines in 1 file changed: 8 ins; 2 del; 5 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/2075.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/2075/head:pull/2075

PR: https://git.openjdk.org/jdk21u-dev/pull/2075


More information about the jdk-updates-dev mailing list