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)
llvm-svn: 303408

llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp

index 035b2c0..e8d967b 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);