Check for null MDNode element while printing comment.

llvm-svn: 83172
This commit is contained in:
Devang Patel 2009-09-30 21:26:51 +00:00
parent 53904987ae
commit 48575e3f2e
1 changed files with 1 additions and 1 deletions

View File

@ -874,7 +874,7 @@ static void WriteMDNodeComment(const MDNode *Node,
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;