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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 15725018: Fix bug in SsaConstructionFieldTypes: handle mulitple assignments to the same field. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/language/compiler_annotations.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 23664)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -1469,8 +1469,11 @@
// Don't handle fields defined in superclasses. Given that the field is
// always added to the [allSetters] set, setting a field defined in a
// superclass will get an inferred type of UNKNOWN.
- if (identical(work.element.getEnclosingClass(), field.getEnclosingClass()) &&
- !value.instructionType.isUnknown()) {
+ if (work.element.getEnclosingClass() == field.getEnclosingClass()) {
+ HType existing = currentFieldSetters[field];
+ if (existing != null) {
+ type = existing.union(type, backend.compiler);
+ }
currentFieldSetters[field] = type;
}
}
@@ -1481,6 +1484,7 @@
if (!thisExposed) {
// Register the known field types.
currentFieldSetters.forEach((Element element, HType type) {
+ if (type.isUnknown()) return;
backend.registerFieldConstructor(element, type);
allSetters.remove(element);
});
« no previous file with comments | « no previous file | tests/language/compiler_annotations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698