diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2008-09-02 11:30:10 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2008-09-02 11:30:10 +0000 |
commit | 6e95d90b4ce3e7545b8e8b4d0321261fb93b1a15 (patch) | |
tree | 395beea3aaf4d6085c3a56f5302e9752508c0b67 /lib/VMCore/Verifier.cpp | |
parent | 0783f0d0a3d07a05c493fdd8b9a8b89eee467117 (diff) | |
download | external_llvm-6e95d90b4ce3e7545b8e8b4d0321261fb93b1a15.zip external_llvm-6e95d90b4ce3e7545b8e8b4d0321261fb93b1a15.tar.gz external_llvm-6e95d90b4ce3e7545b8e8b4d0321261fb93b1a15.tar.bz2 |
plug a little memleak in verifyFunction()
# first commit to llvm, so whatch out :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 034a062..5ca8e1a 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1512,10 +1512,12 @@ bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) { Function &F = const_cast<Function&>(f); assert(!F.isDeclaration() && "Cannot verify external functions"); - FunctionPassManager FPM(new ExistingModuleProvider(F.getParent())); + ExistingModuleProvider MP(F.getParent()); + FunctionPassManager FPM(&MP); Verifier *V = new Verifier(action); FPM.add(V); FPM.run(F); + MP.releaseModule(); return V->Broken; } |