Skip to content

Commit 1bcf635

Browse files
BeyondMagicCopilot
andcommitted
fix(optimizer): free correctly smt
Co-authored-by: Copilot <[email protected]>
1 parent e38ad55 commit 1bcf635

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/optimizer.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,7 @@ static void optimize_if_constants(AstBlock *block)
146146
stmt->data.if_stmt.else_branch = NULL;
147147
}
148148

149-
ast_expr_list_destroy(NULL);
150-
{
151-
}
152-
free(stmt->data.if_stmt.condition);
153-
free(stmt);
149+
ast_stmt_destroy(stmt);
154150

155151
if (replacement)
156152
{

0 commit comments

Comments
 (0)