From e79719ce607b6130e41e23dbdc90cc6b4e0401e6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 5 Feb 2019 18:38:58 +0000 Subject: Vendor import of llvm release_80 branch r353167: https://llvm.org/svn/llvm-project/llvm/branches/release_80@353167 --- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/AsmPrinter/CodeViewDebug.cpp') diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 8cabad4ad3123..154f81f2622d4 100644 --- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1836,7 +1836,10 @@ TypeIndex CodeViewDebug::lowerTypeMemberFunction(const DISubroutineType *Ty, unsigned Index = 0; SmallVector ArgTypeIndices; - TypeIndex ReturnTypeIndex = getTypeIndex(ReturnAndArgs[Index++]); + TypeIndex ReturnTypeIndex = TypeIndex::Void(); + if (ReturnAndArgs.size() > Index) { + ReturnTypeIndex = getTypeIndex(ReturnAndArgs[Index++]); + } // If the first argument is a pointer type and this isn't a static method, // treat it as the special 'this' parameter, which is encoded separately from -- cgit v1.2.3