VMCore/DebugInfo.cpp: DICompileUnit::getSubprograms(): Check numOperands().

2012-11-30-misched-dbg.ll had crashed. Then (MDNode)N was "!{}".
I am not sure it would be ill-formed or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169074 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2012-12-01 02:23:45 +00:00
parent 4259a1a7d8
commit 2587a8a18c

View File

@ -659,6 +659,7 @@ DIArray DICompileUnit::getSubprograms() const {
return DIArray();
if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(12)))
if (N->getNumOperands() > 0)
if (MDNode *A = dyn_cast_or_null<MDNode>(N->getOperand(0)))
return DIArray(A);
return DIArray();