| ... | @@ -2119,14 +2119,16 @@ fn transForLoop( | ... | @@ -2119,14 +2119,16 @@ fn transForLoop( |
| 2119 | .parent = scope, | 2119 | .parent = scope, |
| 2120 | .id = .Loop, | 2120 | .id = .Loop, |
| 2121 | }; | 2121 | }; |
| 2122 | var block = false; | 2122 | |
| 2123 | var block_scope: ?*Scope.Block = null; | 2123 | var block_scope: ?*Scope.Block = null; |
| 2124 | if (ZigClangForStmt_getInit(stmt)) |init| { | 2124 | if (ZigClangForStmt_getInit(stmt)) |init| { |
| 2125 | block_scope = try Scope.Block.init(rp.c, scope, null); | 2125 | block_scope = try Scope.Block.init(rp.c, scope, null); |
| 2126 | block_scope.?.block_node = try transCreateNodeBlock(rp.c, null); | 2126 | const block = try transCreateNodeBlock(rp.c, null); |
| | 2127 | block_scope.?.block_node = block; |
| 2127 | loop_scope.parent = &block_scope.?.base; | 2128 | loop_scope.parent = &block_scope.?.base; |
| 2128 | const init_stmt = try transStmt(rp, &loop_scope, init, .unused, .r_value); | 2129 | const result = try transStmt(rp, &block_scope.?.base, init, .unused, .r_value); |
| 2129 | try block_scope.?.block_node.statements.push(init_stmt); | 2130 | if (result != &block.base) |
| | 2131 | try block.statements.push(result); |
| 2130 | } | 2132 | } |
| 2131 | var cond_scope = Scope{ | 2133 | var cond_scope = Scope{ |
| 2132 | .parent = scope, | 2134 | .parent = scope, |