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

Unified Diff: src/typing-asm.cc

Issue 2040983002: [asmjs] Validator should reject modules with repeated functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/cctest/test-asm-validator.cc » ('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 d98998520fae35bbc16c305979a6123df1be0cd7..fc6309141729c04842fddeb1c3ee2cdeaa177bf3 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -166,6 +166,10 @@ void AsmTyper::VisitFunctionDeclaration(FunctionDeclaration* decl) {
// Set function type so global references to functions have some type
// (so they can give a more useful error).
Variable* var = decl->proxy()->var();
+ if (GetVariableInfo(var)) {
+ // Detect previously-seen functions.
+ FAIL(decl->fun(), "function repeated in module");
+ }
SetType(var, Type::Function());
}
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698