mirror of
https://github.com/bellard/quickjs.git
synced 2024-12-12 09:44:33 +08:00
fix crash when add property maybe failed on build arguments
This commit is contained in:
parent
6e2e68fd08
commit
1dafd6b04f
@ -14855,6 +14855,10 @@ static JSValue js_build_arguments(JSContext *ctx, int argc, JSValueConst *argv)
|
||||
/* add the length field (cannot fail) */
|
||||
pr = add_property(ctx, p, JS_ATOM_length,
|
||||
JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
|
||||
if (!pr) {
|
||||
JS_FreeValue(ctx, val);
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
pr->u.value = JS_NewInt32(ctx, argc);
|
||||
|
||||
/* initialize the fast array part */
|
||||
@ -14904,6 +14908,8 @@ static JSValue js_build_mapped_arguments(JSContext *ctx, int argc,
|
||||
/* add the length field (cannot fail) */
|
||||
pr = add_property(ctx, p, JS_ATOM_length,
|
||||
JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
|
||||
if (!pr)
|
||||
goto fail;
|
||||
pr->u.value = JS_NewInt32(ctx, argc);
|
||||
|
||||
for(i = 0; i < arg_count; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user