mirror of
https://github.com/bellard/quickjs.git
synced 2025-05-15 10:45:02 +08:00
fixed detached TypedArray handling in Atomics operations
This commit is contained in:
parent
334aa18013
commit
fbf7d8a205
@ -53807,6 +53807,11 @@ static void *js_atomics_get_ptr(JSContext *ctx,
|
|||||||
if (JS_ToIndex(ctx, &idx, idx_val)) {
|
if (JS_ToIndex(ctx, &idx, idx_val)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
/* RevalidateAtomicAccess(): must test again detached after JS_ToIndex() */
|
||||||
|
if (abuf->detached) {
|
||||||
|
JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
/* if the array buffer is detached, p->u.array.count = 0 */
|
/* if the array buffer is detached, p->u.array.count = 0 */
|
||||||
if (idx >= p->u.array.count) {
|
if (idx >= p->u.array.count) {
|
||||||
JS_ThrowRangeError(ctx, "out-of-bound access");
|
JS_ThrowRangeError(ctx, "out-of-bound access");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user