]> granicus.if.org Git - llvm/commitdiff
Don't crash if someone tries to visit an empty type stream.
authorZachary Turner <zturner@google.com>
Fri, 19 May 2017 05:18:09 +0000 (05:18 +0000)
committerZachary Turner <zturner@google.com>
Fri, 19 May 2017 05:18:09 +0000 (05:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303408 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/CodeView/CVTypeVisitor.cpp

index 035b2c0a6afce82c6b81f84521d270362dcf7874..e8d967b6389f5645b5b624d9417a41e73a61cea1 100644 (file)
@@ -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);