From 872bc2d17f6d51fd8fc22ea81f5638b4aa7d1be3 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 26 Jan 2020 01:06:48 +0100 Subject: [PATCH] [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/+/2020943 Reviewed-by: Jakob Kummerow Commit-Queue: Jakob Kummerow Cr-Commit-Position: refs/heads/master@{#65995} --- src/api/api.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/api.cc b/src/api/api.cc index 6a1f4862e8..d192e74163 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -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();