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

Unified Diff: src/asmjs/asm-typer.cc

Issue 2268363002: [Asm.js] Prevents assignments to immutables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addresses comments. Created 4 years, 4 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/asmjs/test-asm-typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-typer.cc
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc
index 4415c30ac6a32b3c6ea59981e7aaa59d11a8f1bc..1d070a020758f086bf3d16786117df1231068ea8 100644
--- a/src/asmjs/asm-typer.cc
+++ b/src/asmjs/asm-typer.cc
@@ -1744,7 +1744,11 @@ AsmType* AsmTyper::ValidateAssignmentExpression(Assignment* assignment) {
return value_type;
}
- DCHECK(target_info->type() != AsmType::None());
+ if (!target_info->IsMutable()) {
+ FAIL(assignment, "Can't assign to immutable symbol.");
+ }
+
+ DCHECK_NE(AsmType::None(), target_info->type());
if (!value_type->IsA(target_info->type())) {
FAIL(assignment, "Type mismatch in assignment.");
}
« no previous file with comments | « no previous file | test/cctest/asmjs/test-asm-typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698