Skip to content

Commit

Permalink
Follow up to 6e03a68, squelch another leak
Browse files Browse the repository at this point in the history
This patch is a sticking-paster until D118774 solves the situation with
unique_ptrs. I'm certainly wishing I'd focused on that first X_X.
  • Loading branch information
jmorse committed Feb 2, 2022
1 parent 298331f commit 4654fa8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2929,8 +2929,15 @@ bool InstrRefBasedLDV::depthFirstVLocAndEmit(
VTracker = nullptr;

// No scopes? No variable locations.
if (!LS.getCurrentFunctionScope())
if (!LS.getCurrentFunctionScope()) {
// FIXME: this is a sticking plaster to prevent a memory leak, these
// pointers will be automagically freed by being unique pointers, shortly.
for (unsigned int I = 0; I < MaxNumBlocks; ++I) {
delete[] MInLocs[I];
delete[] MOutLocs[I];
}
return false;
}

// Build map from block number to the last scope that uses the block.
SmallVector<unsigned, 16> EjectionMap;
Expand Down

0 comments on commit 4654fa8

Please sign in to comment.