diff options
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 9421070e7..21bf68b62 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -168,7 +168,12 @@ void WasmValidator::visitSwitch(Switch *curr) { void WasmValidator::visitCall(Call *curr) { if (!validateGlobally) return; auto* target = getModule()->getFunctionOrNull(curr->target); - if (!shouldBeTrue(!!target, curr, "call target must exist")) return; + if (!shouldBeTrue(!!target, curr, "call target must exist")) { + if (getModule()->getImportOrNull(curr->target)) { + std::cerr << "(perhaps it should be a CallImport instead of Call?)\n"; + } + return; + } if (!shouldBeTrue(curr->operands.size() == target->params.size(), curr, "call param number must match")) return; for (size_t i = 0; i < curr->operands.size(); i++) { if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, target->params[i], curr, "call param types must match")) { |