Skip to content

Commit

Permalink
fix: Fixed while loop deleting body memory twice
Browse files Browse the repository at this point in the history
  • Loading branch information
alinalihassan committed Sep 16, 2022
1 parent 21f0497 commit cd031fb
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/liblesma/AST/AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ namespace lesma {
public:
While(llvm::SMRange Loc, Expression *cond, Compound *block) : Statement(Loc), cond(cond), block(block) {}
~While() override {
for (auto stmt: block->getChildren())
delete stmt;

delete cond;
delete block;
}
Expand Down

0 comments on commit cd031fb

Please sign in to comment.