NamedMDNode element is either null or MDNode. Otherwise this is a malformed NamedMDNode record.

llvm-svn: 93037
This commit is contained in:
Devang Patel
2010-01-09 01:02:22 +00:00
parent ea208bf99c
commit fbb47c2300
+3 -1
View File
@@ -793,8 +793,10 @@ bool BitcodeReader::ParseMetadata() {
Elts.push_back(NULL);
else {
Value *MD = MDValueList.getValueFwdRef(Record[i]);
if (MDNode *B = dyn_cast_or_null<MDNode>(MD))
if (MDNode *B = dyn_cast<MDNode>(MD))
Elts.push_back(B);
else
return Error("Malformed metadata record");
}
}
Value *V = NamedMDNode::Create(Context, Name.str(), Elts.data(),