aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-20 00:18:10 +0000
committerChris Lattner <sabre@nondot.org>2007-03-20 00:18:10 +0000
commit91857da2f53d9abc620cf944465d2899c517a5b5 (patch)
treea7050cd84716cdceff9de33b202c861f3649e195 /lib/VMCore
parent5f6a89562d5faeec3cf5e141373917284c34102d (diff)
downloadexternal_llvm-91857da2f53d9abc620cf944465d2899c517a5b5.zip
external_llvm-91857da2f53d9abc620cf944465d2899c517a5b5.tar.gz
external_llvm-91857da2f53d9abc620cf944465d2899c517a5b5.tar.bz2
Fix a nasty memory leak, caused by my revamp of the value symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Value.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 8bc99a8..790ae17 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -56,6 +56,11 @@ Value::~Value() {
#endif
assert(use_begin() == use_end() && "Uses remain when a value is destroyed!");
+ // If this value is named, destroy the name. This should not be in a symtab
+ // at this point.
+ if (Name)
+ Name->Destroy();
+
// There should be no uses of this object anymore, remove it.
LeakDetector::removeGarbageObject(this);
}