[llvm] e63b18b - Catch an extremely obvious memory leak, thanks asan

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 07:48:02 PDT 2021


Author: Jeremy Morse
Date: 2021-06-29T15:47:17+01:00
New Revision: e63b18bc84a27718266f5c838a572ba423f70a2c

URL: https://github.com/llvm/llvm-project/commit/e63b18bc84a27718266f5c838a572ba423f70a2c
DIFF: https://github.com/llvm/llvm-project/commit/e63b18bc84a27718266f5c838a572ba423f70a2c.diff

LOG: Catch an extremely obvious memory leak, thanks asan

https://lab.llvm.org/buildbot/#/builders/5/builds/9208

(dbg-phis-merging-in-ldv.mir and dbg-phis-with-loops.mir in the asan
 check stage)

Added: 
    

Modified: 
    llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 8e0588241bb2..75e551b66518 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -3574,6 +3574,9 @@ class LDVSSAUpdater {
   LDVSSAUpdater(LocIdx L, ValueIDNum **MLiveIns) : Loc(L), MLiveIns(MLiveIns) {}
 
   void reset() {
+    for (auto &Block : BlockMap)
+      delete Block.second;
+
     PHIs.clear();
     UndefMap.clear();
     BlockMap.clear();


        


More information about the llvm-commits mailing list