Commit 997d88e6 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm] Always set message when TypecheckJSObject fails

Change-Id: Ifca0084272ec1f5ec781452c2a54d25cb4e80c95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2807718Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73823}
parent 1d63316a
......@@ -2229,8 +2229,12 @@ bool TypecheckJSObject(Isolate* isolate, const WasmModule* module,
}
}
default:
// Tables defined outside a module can't refer to user-defined types.
if (module == nullptr) return false;
if (module == nullptr) {
*error_message =
"an object defined in JavaScript cannot be compatible with a "
"type defined in a Webassembly module";
return false;
}
DCHECK(module->has_type(expected.ref_index()));
if (module->has_signature(expected.ref_index())) {
if (WasmExportedFunction::IsWasmExportedFunction(*value)) {
......
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