[llvm-commits] [llvm] r83172 - /llvm/trunk/lib/VMCore/AsmWriter.cpp
Devang Patel
dpatel at apple.com
Wed Sep 30 14:26:52 PDT 2009
Author: dpatel
Date: Wed Sep 30 16:26:51 2009
New Revision: 83172
URL: http://llvm.org/viewvc/llvm-project?rev=83172&view=rev
Log:
Check for null MDNode element while printing comment.
Modified:
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=83172&r1=83171&r2=83172&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Sep 30 16:26:51 2009
@@ -874,7 +874,7 @@
formatted_raw_ostream &Out) {
if (Node->getNumElements() < 1)
return;
- ConstantInt *CI = dyn_cast<ConstantInt>(Node->getElement(0));
+ ConstantInt *CI = dyn_cast_or_null<ConstantInt>(Node->getElement(0));
if (!CI) return;
unsigned Val = CI->getZExtValue();
unsigned Tag = Val & ~LLVMDebugVersionMask;
More information about the llvm-commits
mailing list