From 872814ae048df032bddf9299c850f5bda08299a9 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 21 Jul 2010 18:54:18 +0000 Subject: 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109028 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index f486b51cae..7d82321afc 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -803,10 +803,6 @@ bool BitcodeReader::ParseMetadata() { unsigned Size = Record.size(); SmallVector Elts; for (unsigned i = 0; i != Size; ++i) { - if (Record[i] == ~0U) { - Elts.push_back(NULL); - continue; - } MDNode *MD = dyn_cast(MDValueList.getValueFwdRef(Record[i])); if (MD == 0) return Error("Malformed metadata record"); -- cgit v1.2.3-18-g5258