summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commitaf867a393797d56d6aa922f02540d384880bc92c (patch)
tree38ffa1813fc20fae67b2871781e9d2bf21002c77 /llvm/lib
parent6682721316a6916b2bfd1c2996cdcb2048c7348f (diff)
downloadbcm5719-llvm-af867a393797d56d6aa922f02540d384880bc92c.tar.gz
bcm5719-llvm-af867a393797d56d6aa922f02540d384880bc92c.zip
Fix a nasty memory leak, caused by my revamp of the value symbol table.
llvm-svn: 35195
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Value.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index 8bc99a8590b..790ae17a983 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud