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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1313183007: dart2js cps: Interceptor can be null if input is null. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index ab1b0c0a702eb24620a8a90947f7d2caa029d0fe..2e2da582d2a10fcb850cac6e2716f41d6258305f 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -2551,7 +2551,16 @@ class TypePropagationVisitor implements Visitor {
void visitInterceptor(Interceptor node) {
push(node.input.definition);
AbstractValue value = getValue(node.input.definition);
- if (!value.isNothing) {
+ if (value.isNothing) {
+ setValue(node, nothing);
+ } else if (value.isNullable &&
+ !node.interceptedClasses.contains(backend.jsNullClass)) {
+ // If the input is null and null is not mapped to an interceptor then
+ // null gets returned.
+ // TODO(asgerf): Add the NullInterceptor when it enables us to
+ // propagate an assignment.
+ setValue(node, nonConstant());
+ } else {
setValue(node, nonConstant(typeSystem.nonNullType));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698