diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-04-21 16:14:00 +0200 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-04-21 16:14:00 +0200 |
commit | fbf7d8a205e9ecbefed5d72947c53272405d2cee (patch) | |
tree | c6d500e5f1a949af94afc975d816965bcb08fda6 | |
parent | 334aa18013f8b3889b8bdddfea68e35830dbcadc (diff) | |
download | quickjs-fbf7d8a205e9ecbefed5d72947c53272405d2cee.tar.gz quickjs-fbf7d8a205e9ecbefed5d72947c53272405d2cee.zip |
fixed detached TypedArray handling in Atomics operations
-rw-r--r-- | quickjs.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -53807,6 +53807,11 @@ static void *js_atomics_get_ptr(JSContext *ctx, if (JS_ToIndex(ctx, &idx, idx_val)) { 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 (idx >= p->u.array.count) { JS_ThrowRangeError(ctx, "out-of-bound access"); |