diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-12-01 02:23:45 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-12-01 02:23:45 +0000 |
commit | 7fe8a4032a6cf35c19feb024a0e17ec96d88800a (patch) | |
tree | 0c1d7f7d774c48ddf1953b92cec4582639a2e16c /llvm/lib/VMCore/DebugInfo.cpp | |
parent | 40f1d858071f3e21db97e357c0b5d4bdce109091 (diff) | |
download | bcm5719-llvm-7fe8a4032a6cf35c19feb024a0e17ec96d88800a.tar.gz bcm5719-llvm-7fe8a4032a6cf35c19feb024a0e17ec96d88800a.zip |
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.
llvm-svn: 169074
Diffstat (limited to 'llvm/lib/VMCore/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/VMCore/DebugInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/DebugInfo.cpp b/llvm/lib/VMCore/DebugInfo.cpp index 5eea2ce9e0a..a4fd705e30c 100644 --- a/llvm/lib/VMCore/DebugInfo.cpp +++ b/llvm/lib/VMCore/DebugInfo.cpp @@ -659,8 +659,9 @@ DIArray DICompileUnit::getSubprograms() const { return DIArray(); if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(12))) - if (MDNode *A = dyn_cast_or_null<MDNode>(N->getOperand(0))) - return DIArray(A); + if (N->getNumOperands() > 0) + if (MDNode *A = dyn_cast_or_null<MDNode>(N->getOperand(0))) + return DIArray(A); return DIArray(); } |