Fix the underlying cause for the asan test failure introduced by cl/210618122.

Restored the order of deleting then-clause before else-clause in if-statement destructor, since it does not and should not matter.

PiperOrigin-RevId: 211273720
This commit is contained in:
Tatiana Shpeisman 2018-09-02 08:48:54 -07:00 committed by jpienaar
parent cedc28483f
commit 2d29d98df0
2 changed files with 3 additions and 1 deletions

View File

@ -108,6 +108,7 @@ public:
other.removeFromCurrent();
value = other.value;
other.value = nullptr;
other.back = nullptr;
nextUse = nullptr;
back = nullptr;
insertIntoCurrent();

View File

@ -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.
}