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

Unified Diff: src/typing-asm.cc

Issue 1569423002: Reject lack of "use asm" marker in asm typer. (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/cctest/test-asm-validator.cc » ('j') | test/cctest/test-asm-validator.cc » ('J')
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 b969d45166586ae35feb774bee642f6662c0e52a..7074169355108498c090d260c399e9d4e6eb8c5d 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -76,6 +76,13 @@ void AsmTyper::VisitAsmModule(FunctionLiteral* fun) {
Scope* scope = fun->scope();
if (!scope->is_function_scope()) FAIL(fun, "not at function scope");
+ ExpressionStatement* use_asm = fun->body()->first()->AsExpressionStatement();
+ if (use_asm == NULL) FAIL(fun, "missing \"use asm\"");
+ Literal* use_asm_literal = use_asm->expression()->AsLiteral();
+ if (use_asm_literal == NULL) FAIL(fun, "missing \"use asm\"");
+ if (!use_asm_literal->raw_value()->AsString()->IsOneByteEqualTo("use asm"))
+ FAIL(fun, "missing \"use asm\"");
+
// Module parameters.
for (int i = 0; i < scope->num_parameters(); ++i) {
Variable* param = scope->parameter(i);
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | test/cctest/test-asm-validator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698