]> git.kaiwu.me - quickjs.git/commitdiff
fixed js_proxy_isArray stack overflow (github issue #178)
authorbellard <6490144+bellard@users.noreply.github.com>
Fri, 1 Dec 2023 17:15:03 +0000 (18:15 +0100)
committerbellard <6490144+bellard@users.noreply.github.com>
Fri, 1 Dec 2023 17:15:03 +0000 (18:15 +0100)
quickjs.c

index 79160139174065b4bf8e64eba1b87048682f5a92..113c447b39d6ded05625ce010abf053ebff57a12 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -45243,6 +45243,10 @@ static int js_proxy_isArray(JSContext *ctx, JSValueConst obj)
     JSProxyData *s = JS_GetOpaque(obj, JS_CLASS_PROXY);
     if (!s)
         return FALSE;
+    if (js_check_stack_overflow(ctx->rt, 0)) {
+        JS_ThrowStackOverflow(ctx);
+        return -1;
+    }
     if (s->is_revoked) {
         JS_ThrowTypeErrorRevokedProxy(ctx);
         return -1;