Commit 668e48bd authored by Sigurd Schneider's avatar Sigurd Schneider Committed by V8 LUCI CQ

Suppress exceptions due to exception meta-data

Associating exception meta-data may throw an exception if the
browser is under memory pressure. This CL adds a try-catch
scope to prevent surfacing of said exceptions in Chrome.

Bug: chromium:1226360
Change-Id: Ide969273b2ac6dc109370ba2adcb20586ef30bff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3008214Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75580}
parent dc6acd15
...@@ -402,6 +402,7 @@ V8ConsoleMessage::getAssociatedExceptionData( ...@@ -402,6 +402,7 @@ V8ConsoleMessage::getAssociatedExceptionData(
inspector->getAssociatedExceptionData(exception); inspector->getAssociatedExceptionData(exception);
v8::Local<v8::Object> data; v8::Local<v8::Object> data;
if (!maybe_data.ToLocal(&data)) return nullptr; if (!maybe_data.ToLocal(&data)) return nullptr;
v8::TryCatch tryCatch(isolate);
v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope microtasksScope(isolate,
v8::MicrotasksScope::kDoNotRunMicrotasks); v8::MicrotasksScope::kDoNotRunMicrotasks);
v8::Context::Scope contextScope(context); v8::Context::Scope contextScope(context);
......
...@@ -512,6 +512,7 @@ bool V8InspectorImpl::associateExceptionData(v8::Local<v8::Context>, ...@@ -512,6 +512,7 @@ bool V8InspectorImpl::associateExceptionData(v8::Local<v8::Context>,
} }
v8::Local<v8::Context> context; v8::Local<v8::Context> context;
if (!exceptionMetaDataContext().ToLocal(&context)) return false; if (!exceptionMetaDataContext().ToLocal(&context)) return false;
v8::TryCatch tryCatch(m_isolate);
v8::Context::Scope contextScope(context); v8::Context::Scope contextScope(context);
v8::HandleScope handles(m_isolate); v8::HandleScope handles(m_isolate);
if (m_exceptionMetaData.IsEmpty()) if (m_exceptionMetaData.IsEmpty())
......
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