Do the right thing on NULL uint64 fields.

Patch by Clemens Hammacher!

Fixes PR12243

llvm-svn: 152880
This commit is contained in:
Eric Christopher 2012-03-16 00:21:54 +00:00
parent ecbe8b4fab
commit a4a0cf8394
2 changed files with 7 additions and 1 deletions

View File

@ -68,7 +68,7 @@ uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const {
return 0;
if (Elt < DbgNode->getNumOperands())
if (ConstantInt *CI = dyn_cast<ConstantInt>(DbgNode->getOperand(Elt)))
if (ConstantInt *CI = dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(Elt)))
return CI->getZExtValue();
return 0;

View File

@ -0,0 +1,6 @@
; RUN: llc
!llvm.dbg.cu = !{!0}
!0 = metadata !{null, null, null}