Commit 606e7022 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

Harden Isolate::InstallConditionalFeatures

This function should properly forward any exceptions it encounters,
instead of silently swallowing them. Being an API function, that
means moving them from "pending" to "scheduled" state.

Fixed: v8:13123
Change-Id: I20b0782fd806e456f14dda84100000c857481d09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3825880Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82386}
parent c1955197
......@@ -9468,13 +9468,17 @@ void Isolate::InstallConditionalFeatures(Local<Context> context) {
v8::HandleScope handle_scope(this);
v8::Context::Scope context_scope(context);
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
if (i_isolate->is_execution_terminating()) return;
i_isolate->InstallConditionalFeatures(Utils::OpenHandle(*context));
#if V8_ENABLE_WEBASSEMBLY
if (i::FLAG_expose_wasm) {
if (i::FLAG_expose_wasm && !i_isolate->has_pending_exception()) {
i::WasmJs::InstallConditionalFeatures(i_isolate,
Utils::OpenHandle(*context));
}
#endif // V8_ENABLE_WEBASSEMBLY
if (i_isolate->has_pending_exception()) {
i_isolate->OptionalRescheduleException(false);
}
}
void Isolate::AddNearHeapLimitCallback(v8::NearHeapLimitCallback callback,
......
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Object.defineProperty(this, "WebAssembly", { get: () => { throw "nope" } });
assertThrowsEquals(() => d8.test.installConditionalFeatures(), 'nope');
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