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

Unified Diff: src/typing-asm.cc

Issue 1722473002: Allow intish and floatish to be coerced by heap assignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge Created 4 years, 10 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 f7420e74fdab1a6875ab557bc254a4b32fba7cfb..ddb608fc2cf3154e12282598bfbfd15f83e67867 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -683,19 +683,23 @@ void AsmTyper::VisitAssignment(Assignment* expr) {
RECURSE(VisitWithExpectation(
expr->value(), type, "assignment value expected to match surrounding"));
Type* target_type = StorageType(computed_type_);
- if (intish_ != 0) {
- FAIL(expr, "intish or floatish assignment");
- }
if (expr->target()->IsVariableProxy()) {
+ if (intish_ != 0) {
+ FAIL(expr, "intish or floatish assignment");
+ }
expected_type_ = target_type;
VisitVariableProxy(expr->target()->AsVariableProxy(), true);
} else if (expr->target()->IsProperty()) {
+ int value_intish = intish_;
Property* property = expr->target()->AsProperty();
RECURSE(VisitWithExpectation(property->obj(), Type::Any(),
"bad propety object"));
if (!computed_type_->IsArray()) {
FAIL(property->obj(), "array expected");
}
+ if (value_intish != 0 && computed_type_->Is(cache_.kFloat64Array)) {
+ FAIL(expr, "floatish assignment to double array");
+ }
VisitHeapAccess(property, true, target_type);
}
IntersectResult(expr, target_type);
« 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