From 95239b531cdde12197854dd3611d1ac3f6b7e16f Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 19 May 2017 05:18:09 +0000 Subject: [PATCH] Don't crash if someone tries to visit an empty type stream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303408 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/CodeView/CVTypeVisitor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/DebugInfo/CodeView/CVTypeVisitor.cpp b/lib/DebugInfo/CodeView/CVTypeVisitor.cpp index 035b2c0a6af..e8d967b6389 100644 --- a/lib/DebugInfo/CodeView/CVTypeVisitor.cpp +++ b/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 I = Types.getFirst(); do { CVType Type = Types.getType(*I); -- 2.40.0