Commit ee6ad641 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm][debug] Handle exceptions in interrupts

This was triggered by the inspector fuzzer, which terminates execution
after two seconds. This is done by triggering a termination exception
via an interrupt. In this case, the runtime function should return
immediately, and return the exception sentinel.
This CL fixes the WasmDebugBreak runtime function to do that correctly.

R=thibaudm@chromium.org

Bug: chromium:1215711
Change-Id: Idf8e9769809f135b426e4d1a0ef82fae826050b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3041423Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75838}
parent 930555e2
......@@ -559,7 +559,13 @@ RUNTIME_FUNCTION(Runtime_WasmDebugBreak) {
// Stepping can repeatedly create code, and code GC requires stack guards to
// be executed on all involved isolates. Proactively do this here.
StackLimitCheck check(isolate);
if (check.InterruptRequested()) isolate->stack_guard()->HandleInterrupts();
if (check.InterruptRequested()) {
Object interrupt_object = isolate->stack_guard()->HandleInterrupts();
// Interrupt handling can create an exception, including the
// termination exception.
if (interrupt_object.IsException(isolate)) return interrupt_object;
DCHECK(interrupt_object.IsUndefined(isolate));
}
// Enter the debugger.
DebugScope debug_scope(isolate->debug());
......
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