summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index a6f1c3413e0..fc9324949d0 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -483,6 +483,12 @@ bool DICompositeType::Verify() const {
if (!fieldIsMDNode(DbgNode, 12))
return false;
+ // If this is an array type verify that we have a DIType in the derived type
+ // field as that's the type of our element.
+ if (getTag() == dwarf::DW_TAG_array_type)
+ if (!DIType(getTypeDerivedFrom()))
+ return false;
+
return DbgNode->getNumOperands() >= 10 && DbgNode->getNumOperands() <= 14;
}
OpenPOWER on IntegriCloud