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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart

Issue 1950243002: Do not evaluate on-demand to prevent breaking the deferred loading task (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: also run dartfmt Created 4 years, 7 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 | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index 62a9efd65097fdbb28b463195832d71b25fa1abc..1baa388c4f9d1c473a6b7f7920ae65a537b9658e 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -853,9 +853,13 @@ class TypeGraphInferrerEngine
// For non-container types, the constant handler does
// constant folding that could give more precise results.
ConstantExpression constant = fieldElement.constant;
- if (constant != null) {
- ConstantValue value =
- compiler.backend.constants.getConstantValue(constant);
+ // TODO(johnniwinther): ensure `value` is not null. Note that
+ // calling `evaluate` in getConstantValue may trigger issues for
+ // deferred loading (dartbug.com/26406).
+ ConstantValue value = constant == null
+ ? null
+ : compiler.backend.constants.getConstantValue(constant);
+ if (value != null) {
if (value.isFunction) {
FunctionConstantValue functionConstant = value;
type = types.allocateClosure(node, functionConstant.element);
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698