diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-16 15:17:25 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:54:58 -0700 |
commit | c774db526decf16bfd69d322afc45cc41b4ec070 (patch) | |
tree | 5d6015615a25371611b6ba5decba6e402c7f7158 | |
parent | 34d614a7e9026b793dd5b34d268fa7176d3771bd (diff) | |
download | binaryen-c774db526decf16bfd69d322afc45cc41b4ec070.tar.gz binaryen-c774db526decf16bfd69d322afc45cc41b4ec070.tar.bz2 binaryen-c774db526decf16bfd69d322afc45cc41b4ec070.zip |
a table is needed if there is a call_indirect
-rw-r--r-- | src/wasm-validator.h | 1 |
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"); |