Do not leak memory for passes when using -stopAfterNPasses or -stopraise
authorChris Lattner <sabre@nondot.org>
Sat, 17 Aug 2002 22:40:03 +0000 (22:40 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 17 Aug 2002 22:40:03 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3371 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gccas/gccas.cpp

index 215f5e9bba6431c26f9cf4a536ac1eee3b8cf457..a5ceace4456a6808c514a85bbc638131411cce48 100644 (file)
@@ -58,6 +58,8 @@ static inline void addPass(PassManager &PM, Pass *P) {
 
     // Keep track of how many passes we made for -stopAfterNPasses
     ++NumPassesCreated;
+  } else {
+    delete P;             // We don't want this pass to run, just delete it now
   }
 }