diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2022-02-02 21:00:20 +0000 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2022-02-02 21:02:11 +0000 |
commit | 4654fa89eacca375ff860203697982b873bbd7c8 (patch) | |
tree | 2f8b50eaf496ec91b278d2ae483fdb3107de43da /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | |
parent | 298331f14d0275d17a01fda220ea64a9a1b70bb9 (diff) | |
download | llvm-4654fa89eacca375ff860203697982b873bbd7c8.zip llvm-4654fa89eacca375ff860203697982b873bbd7c8.tar.gz llvm-4654fa89eacca375ff860203697982b873bbd7c8.tar.bz2 |
Follow up to 6e03a68b776dc, 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.
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index 3b4d717..6af5f07 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -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; |