File tree Expand file tree Collapse file tree
src/ScriptEngine/Compiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,7 +388,8 @@ protected override void VisitWhileNode(WhileLoopNode node)
388388 var jumpFalseIndex = AddCommand ( OperationCode . JmpFalse , DUMMY_ADDRESS ) ;
389389
390390 VisitCodeBlock ( node . Children [ 1 ] ) ;
391-
391+ VisitBlockEnd ( node . EndLocation ) ;
392+
392393 AddCommand ( OperationCode . Jmp , conditionIndex ) ;
393394 var endLoop = AddCommand ( OperationCode . Nop ) ;
394395 CorrectCommandArgument ( jumpFalseIndex , endLoop ) ;
@@ -411,11 +412,10 @@ protected override void VisitForEachLoopNode(ForEachLoopNode node)
411412 _nestedLoops . Push ( loopRecord ) ;
412413
413414 VisitIteratorLoopBody ( node . LoopBody ) ;
415+ VisitBlockEnd ( node . EndLocation ) ;
414416
415417 AddCommand ( OperationCode . Jmp , loopBegin ) ;
416418
417- VisitBlockEnd ( node . EndLocation ) ;
418-
419419 var indexLoopEnd = AddCommand ( OperationCode . StopIterator ) ;
420420 CorrectCommandArgument ( condition , indexLoopEnd ) ;
421421 CorrectBreakStatements ( _nestedLoops . Pop ( ) , indexLoopEnd ) ;
You can’t perform that action at this time.
0 commit comments