fix a unitialized pointer in NamedMDNode (and reenable unittest)

llvm-svn: 77597
This commit is contained in:
Benjamin Kramer 2009-07-30 15:35:55 +00:00
parent 2a94b3dcdb
commit 5656e4fcd3
2 changed files with 1 additions and 4 deletions

View File

@ -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]));

View File

@ -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
}