Disallow null as a named metadata operand.
Make MDNode::destroy private. Fix the one thing that used MDNode::destroy, outside of MDNode itself. One should never delete or destroy an MDNode explicitly. MDNodes implicitly go away when there are no references to them (implementation details aside). llvm-svn: 109028
This commit is contained in:
@@ -803,10 +803,6 @@ bool BitcodeReader::ParseMetadata() {
|
||||
unsigned Size = Record.size();
|
||||
SmallVector<MDNode *, 8> Elts;
|
||||
for (unsigned i = 0; i != Size; ++i) {
|
||||
if (Record[i] == ~0U) {
|
||||
Elts.push_back(NULL);
|
||||
continue;
|
||||
}
|
||||
MDNode *MD = dyn_cast<MDNode>(MDValueList.getValueFwdRef(Record[i]));
|
||||
if (MD == 0)
|
||||
return Error("Malformed metadata record");
|
||||
|
||||
Reference in New Issue
Block a user