added missing stack overflow check in JSON.stringify()

This commit is contained in:
Fabrice Bellard 2025-03-13 17:27:38 +01:00
parent 25aaa77370
commit dfd9c93ab0

View File

@ -45412,6 +45412,11 @@ static int js_json_to_str(JSContext *ctx, JSONStringifyContext *jsc,
tab = JS_UNDEFINED;
prop = JS_UNDEFINED;
if (js_check_stack_overflow(ctx->rt, 0)) {
JS_ThrowStackOverflow(ctx);
goto exception;
}
if (JS_IsObject(val)) {
p = JS_VALUE_GET_OBJ(val);
cl = p->class_id;