Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index c47aa351a3409209e7425989dda2314db8cbe815..0aa620722949803b3e733159b5ea10d50a24cea9 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -164,6 +164,7 @@ class ModuleDecoder : public Decoder { |
uint32_t functions_count = consume_u32v("functions count"); |
module->functions.reserve(SafeReserve(functions_count)); |
for (uint32_t i = 0; i < functions_count; ++i) { |
+ if (failed()) break; |
module->functions.push_back({nullptr, // sig |
i, // func_index |
0, // sig_index |