Commit cc9a8a37 authored by Gus Caplan's avatar Gus Caplan Committed by V8 LUCI CQ

fix overflow check in error formatting

Bug: v8:12494
Change-Id: Iba2684173296aa236f1a1c73a5606c21472eff06
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3426634Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Gus Caplan <snek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78909}
parent 10e811c4
......@@ -305,7 +305,8 @@ MaybeHandle<Object> ErrorUtils::FormatStackTrace(Isolate* isolate,
const bool in_recursion = isolate->formatting_stack_trace();
const bool has_overflowed = i::StackLimitCheck{isolate}.HasOverflowed();
Handle<Context> error_context;
if (!in_recursion && error->GetCreationContext().ToHandle(&error_context)) {
if (!in_recursion && !has_overflowed &&
error->GetCreationContext().ToHandle(&error_context)) {
DCHECK(error_context->IsNativeContext());
if (isolate->HasPrepareStackTraceCallback()) {
......@@ -321,7 +322,7 @@ MaybeHandle<Object> ErrorUtils::FormatStackTrace(Isolate* isolate,
isolate->RunPrepareStackTraceCallback(error_context, error, sites),
Object);
return result;
} else if (!has_overflowed) {
} else {
Handle<JSFunction> global_error =
handle(error_context->error_function(), isolate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment