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

Unified Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 2396323004: Bug fix - use type of input, not type of result, for throw-on-null check (Closed)
Patch Set: Created 4 years, 2 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/js_spec_optimization_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index ddeaf26d502e78740c561c9900149e84003683b8..64e12387c5807762a746cc6b90d910d7876e28bf 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -1913,8 +1913,14 @@ class HForeignCode extends HForeign {
accept(HVisitor visitor) => visitor.visitForeignCode(this);
bool isJsStatement() => isStatement;
- bool canThrow() =>
- canBeNull() ? throwBehavior.canThrow : throwBehavior.onNonNull.canThrow;
+ bool canThrow() {
+ if (inputs.length > 0) {
+ return inputs.first.canBeNull()
+ ? throwBehavior.canThrow
+ : throwBehavior.onNonNull.canThrow;
+ }
+ return throwBehavior.canThrow;
+ }
bool onlyThrowsNSM() => throwBehavior.isOnlyNullNSMGuard;
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_spec_optimization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698