]> git.kaiwu.me - quickjs.git/commitdiff
added missing add_arg() error check
authorFabrice Bellard <fabrice@bellard.org>
Sat, 21 Nov 2026 11:28:15 +0000 (12:28 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 21 Nov 2026 11:28:15 +0000 (12:28 +0100)
quickjs.c

index 03af563d47256b385910941be89c6605b3d9adf3..0baef2aabd36e1eba8acfb68fd3be48d43c8c3b7 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -37916,6 +37916,8 @@ static __exception int js_parse_function_decl2(JSParseState *s,
                 } else {
                     /* unnamed arg for destructuring */
                     idx = add_arg(ctx, fd, JS_ATOM_NULL);
+                    if (idx < 0)
+                        goto fail;
                     emit_op(s, OP_get_arg);
                     emit_u16(s, idx);
                 }