Integrated: 8295124: Atomic::add to pointer type may return wrong value

Kim Barrett kbarrett at openjdk.org
Thu Oct 20 22:29:05 UTC 2022


On Wed, 12 Oct 2022 01:09:04 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: 1164258e
Author:    Kim Barrett <kbarrett at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/1164258ec7d173944f48cba368d6c50a07b4c283
Stats:     167 lines in 2 files changed: 152 ins; 3 del; 12 mod

8295124: Atomic::add to pointer type may return wrong value

Reviewed-by: tschatzl, coleenp

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

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


More information about the hotspot-runtime-dev mailing list