Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index 9aaf612134a6a97c90d287e8efeb3b1ebcbd2b72..d01a4f9a97ee45f96deb5d02b878cc4ac8025349 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -512,8 +512,10 @@ class ModuleDecoder : public Decoder { |
WasmFunction* func; |
const byte* pos = pc_; |
module->start_function_index = consume_func_index(module, &func); |
- if (func && func->sig->parameter_count() > 0) { |
- error(pos, "invalid start function: non-zero parameter count"); |
+ if (func && |
+ (func->sig->parameter_count() > 0 || func->sig->return_count() > 0)) { |
+ error(pos, |
+ "invalid start function: non-zero parameter or return count"); |
} |
section_iter.advance(); |
} |