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

Satyen Subramaniam ssubramaniam at openjdk.org
Wed Aug 13 16:39:15 UTC 2025


On Mon, 11 Aug 2025 19:42:21 GMT, Satyen Subramaniam <ssubramaniam at openjdk.org> wrote:

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

This pull request has now been integrated.

Changeset: d2dfbd8c
Author:    Satyen Subramaniam <ssubramaniam at openjdk.org>
URL:       https://git.openjdk.org/jdk21u-dev/commit/d2dfbd8c34c46d70ce20de5a954936d29ab5df66
Stats:     15 lines in 1 file changed: 8 ins; 2 del; 5 mod

8341178: TypeRawPtr::add_offset may be "miscompiled" due to UB

Backport-of: 0a57fe1df6f3431cfb2d5d868597c61ef6af3806

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

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


More information about the jdk-updates-dev mailing list