[llvm-commits] [llvm] r93037 - /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Devang Patel
dpatel at apple.com
Fri Jan 8 17:02:22 PST 2010
Author: dpatel
Date: Fri Jan 8 19:02:22 2010
New Revision: 93037
URL: http://llvm.org/viewvc/llvm-project?rev=93037&view=rev
Log:
NamedMDNode element is either null or MDNode. Otherwise this is a malformed NamedMDNode record.
Modified:
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=93037&r1=93036&r2=93037&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Jan 8 19:02:22 2010
@@ -793,8 +793,10 @@
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(),
More information about the llvm-commits
mailing list