Skip to content

Commit 18a53e9

Browse files
committed
Отладчик не останавливался на КонецЦикла для Пока и ДляКаждого
1 parent c6710c9 commit 18a53e9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ScriptEngine/Compiler/StackMachineCodeGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)