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

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

Issue 1196323002: Fix a bug in dart2js's shrinking reductions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Merge. Created 5 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 | pkg/pkg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index 0e4d97ac02d759d00975e5613589589532b4280c..6ac916253bb82579b3f95b90b9fbcd844ce5f9b0 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -278,9 +278,12 @@ bool _isBetaContLin(Continuation cont) {
// Beta-reduction will move the continuation's body to its unique invocation
// site. This is not safe if the body is moved into an exception handler
- // binding.
+ // binding. Search from the invocation to the continuation binding to
+ // make sure that there is no binding for a handler.
Node current = invoke.parent;
while (current != cont.parent) {
+ // There is no need to reduce a beta-redex inside a deleted subterm.
+ if (current == ShrinkingReducer._DELETED) return false;
if (current is LetHandler) return false;
current = current.parent;
}
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698