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

Unified Diff: src/typing-asm.cc

Issue 1564313003: [wasm] Fix validation error for missing return statement in asm.js module. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/regress/regress-575364.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typing-asm.cc
diff --git a/src/typing-asm.cc b/src/typing-asm.cc
index 6e7b90ccd120f7a30d721b570d375d7d6979d927..b969d45166586ae35feb774bee642f6662c0e52a 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -127,6 +127,9 @@ void AsmTyper::VisitAsmModule(FunctionLiteral* fun) {
// Validate exports.
ReturnStatement* stmt = fun->body()->last()->AsReturnStatement();
+ if (stmt == nullptr) {
+ FAIL(fun->body()->last(), "last statement in module is not a return");
+ }
RECURSE(VisitWithExpectation(stmt->expression(), Type::Object(),
"expected object export"));
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-575364.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698