Commit 1bd9b66c authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Fix trap handler DCHECK in IsValidRefValue

There is a flag in the WebAssembly trap handler that is set whenever
WebAssembly code is entered, and that is reset when WebAssembly code is
left. In runtime functions we have DCHECKs in place that check the
value of this flag.

This flag is only needed when trap handlers are enabled though. When
trap handlers are disabled, the flag is not enabled and disabled
consistently. DCHECKs should therefore only check the flag value when
trap handlers are actually enabled.

R=manoskouk@chromium.org
CC=vkont@google.com

Bug: v8:10982
Change-Id: I3325f6057ff8d9c39d029ef04c55792162d927f6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2545708Reviewed-by: 's avatarManos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71261}
parent 4e12eddd
......@@ -90,7 +90,8 @@ Object ThrowWasmError(Isolate* isolate, MessageTemplate message) {
RUNTIME_FUNCTION(Runtime_WasmIsValidRefValue) {
// This code is called from wrappers, so the "thread is wasm" flag is not set.
DCHECK(!trap_handler::IsThreadInWasm());
DCHECK_IMPLIES(trap_handler::IsTrapHandlerEnabled(),
!trap_handler::IsThreadInWasm());
HandleScope scope(isolate);
DCHECK_EQ(3, args.length());
CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0)
......
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