On Wed, 12 Nov 2025 22:02:07 GMT, Chen Liang <[email protected]> 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.

src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 1786:

> 1784:                                                     V x) {
> 1785:         Object[] array = newSpecialArray(valueType, 2, layout);
> 1786:         return compareAndSetFlatValueAsBytes(array, o, offset, layout, 
> valueType, expected, x) ? x : array[0];

This method should return `array[0]` in all cases.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1734#discussion_r2694405998

Reply via email to