mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 13:08:10 +00:00
dart2js cps: Fix bug in trampoline visitor.
If a continuation was visited directly (as the root of the trampoline) the actions pushed in traverseContinuation would not get processed. BUG= R=kmillikin@google.com Review URL: https://codereview.chromium.org/1427643009 .
This commit is contained in:
parent
b13607d247
commit
b466453025
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue