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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart

Issue 24644004: Fix bug in container tracer, where a local would be updated with the wrong type in the expression `… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | tests/compiler/dart2js/list_tracer3_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart (revision 27876)
+++ sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart (working copy)
@@ -588,24 +588,27 @@
}
}
- if (Elements.isLocal(element)) {
- locals.update(element, rhsType, node);
- }
-
+ TypeMask result;
if (node.isPostfix) {
// We don't check if [getterSelector] could be the container because
// a list++ will always throw.
- return inferrer.returnTypeOfSelector(getterSelector);
+ result = inferrer.returnTypeOfSelector(getterSelector);
} else if (op != '=') {
// We don't check if [getterSelector] could be the container because
// a list += 42 will always throw.
- return inferrer.returnTypeOfSelector(operatorSelector);
+ result = inferrer.returnTypeOfSelector(operatorSelector);
} else {
if (isValueEscaping) {
escaping = true;
}
- return rhsType;
+ result = rhsType;
}
+
+ if (Elements.isLocal(element)) {
+ locals.update(element, result, node);
+ }
+
+ return result;
}
TypeMask visitSuperSend(Send node) {
« no previous file with comments | « no previous file | tests/compiler/dart2js/list_tracer3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698