Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart |
index 1df27b6739fb4e551e378f0aa142018eb6f18a1e..9c56c480ae815a023748b54acf05c05ec7d02c53 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart |
@@ -2067,7 +2067,9 @@ class TrampolineRecursiveVisitor extends DeepRecursiveVisitor { |
if (cont.isReturnContinuation) { |
traverseContinuation(cont); |
} else { |
- _trampoline(traverseContinuation(cont)); |
+ int initialHeight = _stack.length; |
+ Expression body = traverseContinuation(cont); |
+ _trampoline(body, initialHeight: initialHeight); |
} |
} |
@@ -2107,8 +2109,8 @@ class TrampolineRecursiveVisitor extends DeepRecursiveVisitor { |
return node.body; |
} |
- void _trampoline(Expression node) { |
- int initialHeight = _stack.length; |
+ void _trampoline(Expression node, {int initialHeight}) { |
+ initialHeight = initialHeight ?? _stack.length; |
_processBlock(node); |
while (_stack.length > initialHeight) { |
StackAction callback = _stack.removeLast(); |