Skip to content

Commit 54a8365

Browse files
jmorsetstellar
authored andcommitted
Follow up to 6e03a68, squelch another leak
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. (cherry picked from commit 4654fa8)
1 parent 56dcb10 commit 54a8365

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2929,8 +2929,15 @@ bool InstrRefBasedLDV::depthFirstVLocAndEmit(
29292929
VTracker = nullptr;
29302930

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

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

0 commit comments

Comments
 (0)