Don't crash if someone tries to visit an empty type stream.

llvm-svn: 303408
This commit is contained in:
Zachary Turner 2017-05-19 05:18:09 +00:00
parent 59ab6a3816
commit 47fdc73771
1 changed files with 3 additions and 0 deletions

View 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);