Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index 506c7355ab62fca4a9bea16aa0d62a6621b46034..8f92c6e34cf28de44777fd1961df40c08d16f9fb 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -324,7 +324,11 @@ class ModuleDecoder : public Decoder { |
&module->min_mem_pages, &has_max, |
kSpecMaxWasmMemoryPages, |
&module->max_mem_pages); |
- module->has_memory = true; |
+ if (module->has_memory) { |
+ error("At most one memory object is supported"); |
+ } else { |
+ module->has_memory = true; |
+ } |
break; |
} |
case kExternalGlobal: { |