aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2012-12-01 02:23:45 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2012-12-01 02:23:45 +0000
commit2587a8a18c55116b339d4b47d441512067e9c96b (patch)
tree7076e3a01a4e4ae5e5eac556525469c89911c393 /lib/VMCore
parent4259a1a7d8a0f6e8e53bccd516725f8480751a49 (diff)
downloadexternal_llvm-2587a8a18c55116b339d4b47d441512067e9c96b.zip
external_llvm-2587a8a18c55116b339d4b47d441512067e9c96b.tar.gz
external_llvm-2587a8a18c55116b339d4b47d441512067e9c96b.tar.bz2
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
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/DebugInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/DebugInfo.cpp b/lib/VMCore/DebugInfo.cpp
index 5eea2ce..a4fd705 100644
--- a/lib/VMCore/DebugInfo.cpp
+++ b/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();
}