From b9c80fd8b5426514259ae552dfb71b5cdd61a097 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 2 Jun 2016 17:40:51 +0000 Subject: [codeview] Fix crash when handling qualified void types The DIType* for void is the null pointer. A null DIType can never be a qualified type, so we can just exit the loop at this point and go to getTypeIndex(BaseTy). Fixes PR27984 llvm-svn: 271550 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 040bef50f0a..ba0c7ca80b5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -914,8 +914,7 @@ TypeIndex CodeViewDebug::lowerTypeModifier(const DIDerivedType *Ty) { ModifierOptions Mods = ModifierOptions::None; bool IsModifier = true; const DIType *BaseTy = Ty; - while (IsModifier) { - assert(BaseTy); + while (IsModifier && BaseTy) { // FIXME: Need to add DWARF tag for __unaligned. switch (BaseTy->getTag()) { case dwarf::DW_TAG_const_type: -- cgit v1.2.3