Commit 872bc2d1 authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Commit Bot

[api] Fix DCHECK on API failure

Utils::ReportApiFailure() contains logic to handle the case where no
isolate has been entered but it called Isolate::Current(), which DCHECks
when there is no active isolate. Switch to Isolate::TryGetCurrent().

See https://github.com/denoland/rusty_v8/issues/253 for background.

Change-Id: I73c28c31102c0c4ab216a925d22ad54174c7911d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020943Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65995}
parent 4299cb69
......@@ -465,7 +465,7 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location,
}
void Utils::ReportApiFailure(const char* location, const char* message) {
i::Isolate* isolate = i::Isolate::Current();
i::Isolate* isolate = i::Isolate::TryGetCurrent();
FatalErrorCallback callback = nullptr;
if (isolate != nullptr) {
callback = isolate->exception_behavior();
......
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