[lworld] RFR: 8368274: [lworld] Unsafe.compareAndExchangeFlatValue() wrongly assumes padding bytes are the same for identical value objects [v4]
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Jan 22 15:46:14 UTC 2026
On Wed, 21 Jan 2026 22:13:13 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Use the raw value get as witness, because the flat value get may ignore garbage value and cause infinite loop as a result. Waiting for a test case.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>
> Comment update
Marked as reviewed by mcimadamore (Committer).
src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 2867:
> 2865: @ForceInline
> 2866: private boolean compareAndSetFlatValueAsBytes(Object[] array, Object o, long offset, int layout, Class<?> valueType, Object expected, Object x) {
> 2867: // We can convert between a value object and a binary value (of suitable size) using array elements.
Great! Thanks!
-------------
PR Review: https://git.openjdk.org/valhalla/pull/1734#pullrequestreview-3693138969
PR Review Comment: https://git.openjdk.org/valhalla/pull/1734#discussion_r2717467838
More information about the valhalla-dev
mailing list