From c774db526decf16bfd69d322afc45cc41b4ec070 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 16 Aug 2016 15:17:25 -0700 Subject: a table is needed if there is a call_indirect --- src/wasm-validator.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/wasm-validator.h b/src/wasm-validator.h index 5e58ab408..0c3acaf6d 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -176,6 +176,7 @@ public: } } void visitCallIndirect(CallIndirect *curr) { + shouldBeTrue(getModule()->table.segments.size() > 0, curr, "no table"); auto* type = getModule()->checkFunctionType(curr->fullType); if (!shouldBeTrue(!!type, curr, "call_indirect type must exist")) return; shouldBeEqualOrFirstIsUnreachable(curr->target->type, i32, curr, "indirect call target must be an i32"); -- cgit v1.2.3