Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index c816fd3bd4acc5fd06fc1780435b5d372ec9fe0f..5d5bcf2a5bccae4028e07aec2a1ef1fa4626fc78 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -1163,9 +1163,8 @@ FunctionResult DecodeWasmFunction(Isolate* isolate, Zone* zone, |
return decoder.DecodeSingleFunction(module_env, function); |
} |
-FunctionOffsetsResult DecodeWasmFunctionOffsets( |
- const byte* module_start, const byte* module_end, |
- uint32_t num_imported_functions) { |
+FunctionOffsetsResult DecodeWasmFunctionOffsets(const byte* module_start, |
+ const byte* module_end) { |
// Find and decode the code section. |
Vector<const byte> code_section = |
FindSection(module_start, module_end, kCodeSectionCode); |
@@ -1179,12 +1178,9 @@ FunctionOffsetsResult DecodeWasmFunctionOffsets( |
uint32_t functions_count = decoder.consume_u32v("functions count"); |
// Reserve space for the entries, taking care of invalid input. |
if (functions_count < static_cast<unsigned>(code_section.length()) / 2) { |
- table.reserve(num_imported_functions + functions_count); |
+ table.reserve(functions_count); |
} |
- // Add null entries for the imported functions. |
- table.resize(num_imported_functions); |
- |
int section_offset = static_cast<int>(code_section.start() - module_start); |
DCHECK_LE(0, section_offset); |
for (uint32_t i = 0; i < functions_count && decoder.ok(); ++i) { |
@@ -1200,20 +1196,16 @@ FunctionOffsetsResult DecodeWasmFunctionOffsets( |
} |
AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* tables_start, |
- const byte* tables_end, |
- uint32_t num_imported_functions) { |
+ const byte* tables_end) { |
AsmJsOffsets table; |
Decoder decoder(tables_start, tables_end); |
uint32_t functions_count = decoder.consume_u32v("functions count"); |
// Reserve space for the entries, taking care of invalid input. |
if (functions_count < static_cast<unsigned>(tables_end - tables_start)) { |
- table.reserve(num_imported_functions + functions_count); |
+ table.reserve(functions_count); |
} |
- // Add null entries for the imported functions. |
- table.resize(num_imported_functions); |
- |
for (uint32_t i = 0; i < functions_count && decoder.ok(); ++i) { |
uint32_t size = decoder.consume_u32v("table size"); |
if (size == 0) { |