diff --git a/mlir/include/mlir/IR/UseDefLists.h b/mlir/include/mlir/IR/UseDefLists.h index e7cb9f1f2e60..3489eb1e8496 100644 --- a/mlir/include/mlir/IR/UseDefLists.h +++ b/mlir/include/mlir/IR/UseDefLists.h @@ -108,6 +108,7 @@ public: other.removeFromCurrent(); value = other.value; other.value = nullptr; + other.back = nullptr; nextUse = nullptr; back = nullptr; insertIntoCurrent(); diff --git a/mlir/lib/IR/Statement.cpp b/mlir/lib/IR/Statement.cpp index 2a5a2d789468..65ca3403aa87 100644 --- a/mlir/lib/IR/Statement.cpp +++ b/mlir/lib/IR/Statement.cpp @@ -366,10 +366,11 @@ IfStmt::IfStmt(Location *location, unsigned numOperands, IntegerSet *set) } IfStmt::~IfStmt() { + delete thenClause; + if (elseClause) delete elseClause; - delete thenClause; // An IfStmt's IntegerSet 'set' should not be deleted since it is // allocated through MLIRContext's bump pointer allocator. }