Bug 1334799 - Handle stack value in correct order when leaving for-of loop from finally block

Issue #74
This commit is contained in:
janekptacijarabaci 2018-03-25 12:56:18 +02:00 • committed by Roy Tam
commit 62a9d049ec
2 changed files with 31 additions and 7 deletions

View file

@ -2396,6 +2396,9 @@ NonLocalExitControl::prepareForNonLocalJump(BytecodeEmitter::NestableControl* ta
}
}
if (!flushPops(bce_))
return false;
if (target && target->is<ForOfLoopControl>() && emitIteratorCloseAtTarget) {
hasForOfLoopsWithIteratorClose = true;
if (!target->as<ForOfLoopControl>().finishIterCloseTryNote(bce_))
@ -2417,9 +2420,6 @@ NonLocalExitControl::prepareForNonLocalJump(BytecodeEmitter::NestableControl* ta
return false;
}
if (!flushPops(bce_))
return false;
// See comment in ForOfLoopControl.
if (hasForOfLoopsWithIteratorClose) {
for (NestableControl* control = bce_->innermostNestableControl;