aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-07-31 14:22:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-07-31 14:22:13 +0000
commitd77b98376e89225fe2ac50434ae6cd364e944c18 (patch)
tree614b00b914ded5fd62868529ad3a2413bd610352
parent264834be9b1a9f02aefd6c3ebe72d935c166e681 (diff)
downloadexternal_llvm-d77b98376e89225fe2ac50434ae6cd364e944c18.zip
external_llvm-d77b98376e89225fe2ac50434ae6cd364e944c18.tar.gz
external_llvm-d77b98376e89225fe2ac50434ae6cd364e944c18.tar.bz2
Work around a dangling pointer dereference when enumerating NamedMDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77675 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp
index cf4a876..7583bb9 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -227,6 +227,9 @@ void ValueEnumerator::EnumerateValue(const Value *V) {
MetadataBase *M = *I;
EnumerateValue(M);
}
+ Values.push_back(std::make_pair(V, 1U));
+ ValueMap[V] = Values.size();
+ return;
}
// Add the value.