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

Unified Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 23452038: Check cycles in redirecting factories. (Closed) Base URL: https://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 | sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index f9339f03d14b769e54198083f3a195aaa8f06ce0..2c57097e4d0780419cdd47cfe35030b2a5d72ba0 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -713,7 +713,12 @@ class CompileTimeConstantEvaluator extends Visitor {
type = constructor.computeTargetType(compiler, type);
}
- constructor = constructor.redirectionTarget;
+ FunctionElement target = constructor.redirectionTarget;
+ if (target != null) {
+ constructor = target;
+ } else {
+ constructor = constructor.defaultImplementation;
+ }
ClassElement classElement = constructor.getEnclosingClass();
// The constructor must be an implementation to ensure that field
// initializers are handled correctly.
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698