Skip to content

Commit

Permalink
[BOLT] Fix memory error
Browse files Browse the repository at this point in the history
Summary: Fix for double-free I've introduced earlier.

(cherry picked from FBD22132595)
  • Loading branch information
maksfb committed Jun 19, 2020
1 parent db4642d commit 15fffe2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bolt/src/BinaryFunction.cpp
Expand Up @@ -2893,11 +2893,15 @@ void BinaryFunction::setIgnored() {
for (auto BB : BasicBlocks) {
delete BB;
}
clearList(BasicBlocks);

for (auto BB : DeletedBasicBlocks) {
delete BB;
}
BasicBlocks.clear();
BasicBlocksLayout.clear();
clearList(DeletedBasicBlocks);

clearList(BasicBlocksLayout);
clearList(BasicBlocksPreviousLayout);
}

CurrentState = State::Empty;
Expand Down

0 comments on commit 15fffe2

Please sign in to comment.