Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index 8ea4802ef40ea8baf81c966314582cae47d6b8d4..2ac2f9eafaad2e848dcb102d5c671cc0a1fdc551 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -270,6 +270,20 @@ class ModuleDecoder : public Decoder { |
} |
break; |
} |
+ case WasmSection::Code::FunctionTablePad: { |
+ if (!FLAG_wasm_jit_prototype) { |
+ error("FunctionTablePad section without jiting enabled"); |
+ } |
+ // An indirect function table requires functions first. |
+ int length; |
Mircea Trofin
2016/06/21 19:46:14
please initialize length.
|
+ module->indirect_table_size = |
+ consume_u32v(&length, "indirect entry count"); |
+ if (module->indirect_table_size > 0 && |
+ module->indirect_table_size < module->function_table.size()) { |
+ error("more predefined indirect entries than table can hold"); |
+ } |
+ break; |
+ } |
case WasmSection::Code::FunctionTable: { |
// An indirect function table requires functions first. |
CheckForFunctions(module, section); |
@@ -289,6 +303,10 @@ class ModuleDecoder : public Decoder { |
} |
module->function_table.push_back(index); |
} |
+ if (module->indirect_table_size > 0 && |
+ module->indirect_table_size < module->function_table.size()) { |
+ error("more predefined indirect entries than table can hold"); |
+ } |
break; |
} |
case WasmSection::Code::StartFunction: { |