summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-06-02 17:40:51 +0000
committerReid Kleckner <rnk@google.com>2016-06-02 17:40:51 +0000
commitb9c80fd8b5426514259ae552dfb71b5cdd61a097 (patch)
tree014224c6ec0fbe2dd48cf1e647a01f5c8807c81a /llvm/lib/CodeGen
parenta2a2a73c9096cb6fce0e52cb13df1a287886b53e (diff)
downloadbcm5719-llvm-b9c80fd8b5426514259ae552dfb71b5cdd61a097.tar.gz
bcm5719-llvm-b9c80fd8b5426514259ae552dfb71b5cdd61a097.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp3
1 files changed, 1 insertions, 2 deletions
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:
OpenPOWER on IntegriCloud