Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index 4f0304722d1554ff2c118535d95e37e70e042068..6aee4467fdc534762ef6dc48e410c9b054574447 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -31,6 +31,8 @@ namespace { |
const char* kNameString = "name"; |
const size_t kNameStringLength = 4; |
+static const uint32_t kMaxTableSize = 1 << 28; |
+ |
LocalType TypeOf(const WasmModule* module, const WasmInitExpr& expr) { |
switch (expr.kind) { |
case WasmInitExpr::kNone: |
@@ -313,7 +315,7 @@ class ModuleDecoder : public Decoder { |
{0, 0, std::vector<int32_t>(), true, false, SignatureMap()}); |
expect_u8("element type", 0x20); |
WasmIndirectFunctionTable* table = &module->function_tables.back(); |
- consume_resizable_limits("element count", "elements", kMaxUInt32, |
+ consume_resizable_limits("element count", "elements", kMaxTableSize, |
&table->size, &table->max_size); |
break; |
} |