Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: src/wasm/module-decoder.cc

Issue 2458983002: [wasm] Start function must not have a return value. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/wasm/start-function.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | test/mjsunit/wasm/start-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698