summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-16 15:17:25 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:54:58 -0700
commitc774db526decf16bfd69d322afc45cc41b4ec070 (patch)
tree5d6015615a25371611b6ba5decba6e402c7f7158 /src
parent34d614a7e9026b793dd5b34d268fa7176d3771bd (diff)
downloadbinaryen-c774db526decf16bfd69d322afc45cc41b4ec070.tar.gz
binaryen-c774db526decf16bfd69d322afc45cc41b4ec070.tar.bz2
binaryen-c774db526decf16bfd69d322afc45cc41b4ec070.zip
a table is needed if there is a call_indirect
Diffstat (limited to 'src')
-rw-r--r--src/wasm-validator.h1
1 files changed, 1 insertions, 0 deletions
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");