File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,14 @@ export class DoStatementGenerator implements NodeGenerateInterface<ts.DoStatemen
1717 ctx . scope . enclosureFunction . llvmFunction . addBasicBlock ( next ) ;
1818
1919 ctx . scope . breakBlock = next ;
20+ ctx . scope . continueBlock = conditionBlock ;
2021
2122 builder . createBr ( positiveBlock ) ;
2223 builder . setInsertionPoint ( positiveBlock ) ;
2324
2425 passStatement ( < any > node . statement , ctx , builder ) ;
2526
27+ ctx . scope . breakBlock = null ;
2628 ctx . scope . continueBlock = null ;
2729
2830 builder . createBr ( conditionBlock ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export class ForStatementGenerator implements NodeGenerateInterface<ts.ForStatem
4646 }
4747
4848 ctx . scope . breakBlock = next ;
49+ ctx . scope . continueBlock = startBlock ;
4950
5051 builder . setInsertionPoint ( bodyBlock ) ;
5152 passStatement ( node . statement , ctx , builder ) ;
@@ -65,6 +66,7 @@ export class ForStatementGenerator implements NodeGenerateInterface<ts.ForStatem
6566 builder . createBr ( startBlock ) ;
6667
6768 ctx . scope . breakBlock = null ;
69+ ctx . scope . continueBlock = null ;
6870
6971 builder . setInsertionPoint ( next ) ;
7072 }
Original file line number Diff line number Diff line change @@ -20,5 +20,6 @@ export class Scope {
2020 public enclosureFunction : EnclosureFunction ;
2121 public functions : FunctionsTable = new FunctionsTable ( ) ;
2222 public variables : VariablesTable = new VariablesTable ( ) ;
23- public breakBlock : llvm . BasicBlock | null ;
23+ public breakBlock : llvm . BasicBlock | null = null ;
24+ public continueBlock : llvm . BasicBlock | null = null ;
2425}
You can’t perform that action at this time.
0 commit comments