summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-19 05:18:09 +0000
committerZachary Turner <zturner@google.com>2017-05-19 05:18:09 +0000
commit47fdc73771c39a83d97b8eb142dd311eb773e541 (patch)
tree71ba2464e3318b6e7ed1678012a8390914f60a27 /llvm/lib
parent59ab6a381602f102d259706b7cdb13208e31a7bc (diff)
downloadbcm5719-llvm-47fdc73771c39a83d97b8eb142dd311eb773e541.tar.gz
bcm5719-llvm-47fdc73771c39a83d97b8eb142dd311eb773e541.zip
Don't crash if someone tries to visit an empty type stream.
llvm-svn: 303408
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp b/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
index 035b2c0a6af..e8d967b6389 100644
--- a/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
+++ b/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
@@ -227,6 +227,9 @@ Error CVTypeVisitor::visitTypeStream(CVTypeRange Types) {
}
Error CVTypeVisitor::visitTypeStream(TypeCollection &Types) {
+ if (Types.empty())
+ return Error::success();
+
Optional<TypeIndex> I = Types.getFirst();
do {
CVType Type = Types.getType(*I);
OpenPOWER on IntegriCloud