Skip to content

Commit

Permalink
deps: V8: cherry-pick cc9a8a37445e
Browse files Browse the repository at this point in the history
Original commit message:

    fix overflow check in error formatting

    Bug: v8:12494
    Change-Id: Iba2684173296aa236f1a1c73a5606c21472eff06
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3426634
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Gus Caplan <snek@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78909}

Refs: v8/v8@cc9a8a3

PR-URL: #41823
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
devsnek authored and ruyadorno committed Feb 8, 2022
1 parent 49f6b97 commit bee4451
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deps/v8/src/execution/messages.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,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()) {
Expand All @@ -322,7 +323,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);

Expand Down

0 comments on commit bee4451

Please sign in to comment.