Index: src/wasm/ast-decoder.cc |
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc |
index ea7ddcf52813b5f2b6dcdfd0c2a56403b3ab7c13..a2d0a3f0dea04fc42bdb79dda0fadcd0588ca982 100644 |
--- a/src/wasm/ast-decoder.cc |
+++ b/src/wasm/ast-decoder.cc |
@@ -227,6 +227,11 @@ class WasmDecoder : public Decoder { |
} |
inline bool Validate(const byte* pc, CallIndirectOperand& operand) { |
+ uint32_t table_index = 0; |
+ if (!module_->IsValidTable(table_index)) { |
+ error("function table has to exist to execute call_indirect"); |
+ return false; |
+ } |
if (Complete(pc, operand)) { |
return true; |
} |