Chromium Code Reviews

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.
Jump to:
View side-by-side diff with in-line comments
« 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..0c05ab656e133c74f285f6070e3cecb0887a8ad2 100644
--- a/src/asmjs/asm-typer.cc
+++ b/src/asmjs/asm-typer.cc
@@ -1744,7 +1744,10 @@ AsmType* AsmTyper::ValidateAssignmentExpression(Assignment* assignment) {
return value_type;
}
- DCHECK(target_info->type() != AsmType::None());
bradn 2016/08/23 15:56:51 Isn't this still a valid check after the mutable c
John 2016/08/23 16:10:00 It is. Done.
+ if (!target_info->IsMutable()) {
+ FAIL(assignment, "Can't assign to immutable symbol.");
+ }
+
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