aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-07-30 15:35:55 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-07-30 15:35:55 +0000
commit20cc4b8cd907790dd6d50c2b8c72f90518b6052c (patch)
treed26ed111f898b089170cd8e6a9c522ac69ec2103
parenta114baa5bf0d70aed8b8cf576a864005c0d6a128 (diff)
downloadexternal_llvm-20cc4b8cd907790dd6d50c2b8c72f90518b6052c.zip
external_llvm-20cc4b8cd907790dd6d50c2b8c72f90518b6052c.tar.gz
external_llvm-20cc4b8cd907790dd6d50c2b8c72f90518b6052c.tar.bz2
fix a unitialized pointer in NamedMDNode (and reenable unittest)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77597 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Metadata.cpp2
-rw-r--r--unittests/VMCore/MetadataTest.cpp3
2 files changed, 1 insertions, 4 deletions
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp
index cb1dd65..48db0b4 100644
--- a/lib/VMCore/Metadata.cpp
+++ b/lib/VMCore/Metadata.cpp
@@ -35,7 +35,7 @@ void MDNode::Profile(FoldingSetNodeID &ID) const {
//
NamedMDNode::NamedMDNode(const Twine &N, MetadataBase*const* MDs,
unsigned NumMDs, Module *ParentModule)
- : MetadataBase(Type::MetadataTy, Value::NamedMDNodeVal) {
+ : MetadataBase(Type::MetadataTy, Value::NamedMDNodeVal), Parent(0) {
setName(N);
for (unsigned i = 0; i != NumMDs; ++i)
Node.push_back(WeakMetadataVH(MDs[i]));
diff --git a/unittests/VMCore/MetadataTest.cpp b/unittests/VMCore/MetadataTest.cpp
index bdb38ef..22b9099 100644
--- a/unittests/VMCore/MetadataTest.cpp
+++ b/unittests/VMCore/MetadataTest.cpp
@@ -119,8 +119,6 @@ TEST(MDNodeTest, Delete) {
EXPECT_STREQ("!0 = metadata !{null}\n", oss.str().c_str());
}
- // FIXME: Disabled, this crashes on linux.
-#if 0
TEST(NamedMDNodeTest, Search) {
Constant *C = ConstantInt::get(Type::Int32Ty, 1);
Constant *C2 = ConstantInt::get(Type::Int32Ty, 2);
@@ -141,5 +139,4 @@ TEST(NamedMDNodeTest, Search) {
"!1 = metadata !{i32 2}\n",
oss.str().c_str());
}
-#endif
}