Skip to content

Commit

Permalink
Editorial: Fix RevalidateAtomicAccess to check against byte length (#…
Browse files Browse the repository at this point in the history
…3200)

Fixes #3199.

Marking this as editorial because the current spec text always fails and is obviously a bug.
  • Loading branch information
syg authored and ljharb committed Oct 19, 2023
1 parent 392946d commit 4b93d8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -44212,19 +44212,19 @@ <h1>
<h1>
RevalidateAtomicAccess (
_typedArray_: an Integer-Indexed exotic object,
_indexedPosition_: an integer,
_byteIndexInBuffer_: an integer,
): either a normal completion containing ~unused~ or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>This operation revalidates the index for atomic operations after all argument coercions are performed in Atomics methods, argument coercions can have arbitrary side effects, which could cause the buffer to become out of bounds. This operation does not throw when _typedArray_'s backing buffer is a SharedArrayBuffer.</dd>
<dd>This operation revalidates the index within the backing buffer for atomic operations after all argument coercions are performed in Atomics methods, as argument coercions can have arbitrary side effects, which could cause the buffer to become out of bounds. This operation does not throw when _typedArray_'s backing buffer is a SharedArrayBuffer.</dd>
</dl>
<emu-alg>
1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_typedArray_, ~unordered~).
1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer.
1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
1. If _indexedPosition__length_, throw a *RangeError* exception.
1. Assert: _byteIndexInBuffer_ ≥ _typedArray_.[[ByteOffset]].
1. If _byteIndexInBuffer__iieoRecord_.[[CachedBufferByteLength]], throw a *RangeError* exception.
1. Return ~unused~.
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 4b93d8e

Please sign in to comment.