In TypedArrayObject::integerIndexedElementSet check detached buffer correctly

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2025-12-31 10:33:42 +09:00 committed by Patrick Kim
commit 142cf01ad4
2 changed files with 5 additions and 3 deletions

View file

@ -210,7 +210,11 @@ bool TypedArrayObject::integerIndexedElementSet(ExecutionState& state, double in
numValue = Value(Value::DoubleToIntConvertibleTestNeeds, value.toNumber(state));
}
if (buffer()->isDetachedBuffer() || !Value(Value::DoubleToIntConvertibleTestNeeds, index).isInteger(state) || index == Value::MinusZeroIndex || index < 0 || index >= arrayLength()) {
if (buffer()->isDetachedBuffer()) {
return true;
}
if (!Value(Value::DoubleToIntConvertibleTestNeeds, index).isInteger(state) || index == Value::MinusZeroIndex || index < 0 || index >= arrayLength()) {
return false;
}

View file

@ -164,8 +164,6 @@
<test id="built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-limits"><reason>TODO</reason></test>
<test id="built-ins/Temporal/ZonedDateTime/prototype/until/roundingincrement-addition-out-of-range"><reason>TODO</reason></test>
<test id="built-ins/ThrowTypeError/unique-per-realm-function-proto"><reason>TODO</reason></test>
<test id="built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/tonumber-value-detached-buffer"><reason>TODO</reason></test>
<test id="built-ins/TypedArrayConstructors/internals/DefineOwnProperty/tonumber-value-detached-buffer"><reason>TODO</reason></test>
<test id="built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-canonical-invalid-index-prototype-chain-set"><reason>TODO</reason></test>
<test id="built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-canonical-invalid-index-reflect-set"><reason>TODO</reason></test>
<test id="built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-valid-index-prototype-chain-set"><reason>TODO</reason></test>