RFR: 8295124: Atomic::add to pointer type may return wrong value [v2]

Kim Barrett kbarrett at openjdk.org
Wed Oct 12 20:38:10 UTC 2022


> Please review this change to the handling of Atomic pointer arithmetic. When
> the value being modified is a pointer `P*`, the type of the value in the
> destination passed to the platform operation is `const char*`, so a pointer
> type whose pointee is size 1. This allows the platform operation to just treat
> the arithmetic as a simple byte adjustment.
> 
> To demonstrate the problem described in the bug (possible incorrect result for
> Atomic pointer arithmetic) and show that it is now fixed, this change also
> includes some gtests for Atomic operations, including pointer arithmetic which
> fails before the change and succeeds after.
> 
> Testing: mach5 tier1-3

Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:

  conditionalize 64bit tests on 64bit platform

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10667/files
  - new: https://git.openjdk.org/jdk/pull/10667/files/9dbb07a6..e44e81cd

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

  Stats: 6 lines in 1 file changed: 6 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/10667.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10667/head:pull/10667

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


More information about the hotspot-runtime-dev mailing list