| ... | @@ -3015,9 +3015,14 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const Stmt *stmt, | ... | @@ -3015,9 +3015,14 @@ static int trans_stmt_extra(Context *c, TransScope *scope, const Stmt *stmt, |
| 3015 | trans_unary_operator(c, result_used, scope, (const UnaryOperator *)stmt)); | 3015 | trans_unary_operator(c, result_used, scope, (const UnaryOperator *)stmt)); |
| 3016 | case Stmt::DeclStmtClass: | 3016 | case Stmt::DeclStmtClass: |
| 3017 | return trans_local_declaration(c, scope, (const DeclStmt *)stmt, out_node, out_child_scope); | 3017 | return trans_local_declaration(c, scope, (const DeclStmt *)stmt, out_node, out_child_scope); |
| 3018 | case Stmt::WhileStmtClass: | 3018 | case Stmt::WhileStmtClass: { |
| | 3019 | AstNode *while_node = trans_while_loop(c, scope, (const WhileStmt *)stmt); |
| | 3020 | if (while_node->data.while_expr.body == nullptr) { |
| | 3021 | while_node->data.while_expr.body = trans_create_node(c, NodeTypeBlock); |
| | 3022 | } |
| 3019 | return wrap_stmt(out_node, out_child_scope, scope, | 3023 | return wrap_stmt(out_node, out_child_scope, scope, |
| 3020 | trans_while_loop(c, scope, (const WhileStmt *)stmt)); | 3024 | while_node); |
| | 3025 | } |
| 3021 | case Stmt::IfStmtClass: | 3026 | case Stmt::IfStmtClass: |
| 3022 | return wrap_stmt(out_node, out_child_scope, scope, | 3027 | return wrap_stmt(out_node, out_child_scope, scope, |
| 3023 | trans_if_statement(c, scope, (const IfStmt *)stmt)); | 3028 | trans_if_statement(c, scope, (const IfStmt *)stmt)); |