diff options
author | Adrian McCarthy <amccarth@google.com> | 2017-12-19 23:01:17 +0000 |
---|---|---|
committer | Adrian McCarthy <amccarth@google.com> | 2017-12-19 23:01:17 +0000 |
commit | 2ed8f368346f6aba14239148e1c5bc27f9b7c7a9 (patch) | |
tree | db91c25d6815ee9d13fa7d6d3f681d1e70a854ce /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | |
parent | b74d731fb0bee5f6e4f83966a6003c8a552722b4 (diff) | |
download | llvm-2ed8f368346f6aba14239148e1c5bc27f9b7c7a9.zip llvm-2ed8f368346f6aba14239148e1c5bc27f9b7c7a9.tar.gz llvm-2ed8f368346f6aba14239148e1c5bc27f9b7c7a9.tar.bz2 |
Fix faulty assertion in debug info
It appears the code uses nullptr to represent a void type in debug metadata,
which led to an assertion failure when building DeltaAlgorithm.cpp with a
self-hosted clang on Windows.
I'm not sure why/if the problem was Windows-specific.
Fixes bug https://bugs.llvm.org/show_bug.cgi?id=35543
Differential Revision: https://reviews.llvm.org/D41264
llvm-svn: 321122
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index d94b0e5..2e5c224 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -163,7 +163,8 @@ uint64_t DebugHandlerBase::getBaseTypeSize(const DITypeRef TyRef) { DIType *BaseType = DDTy->getBaseType().resolve(); - assert(BaseType && "Unexpected invalid base type"); + if (!BaseType) + return 0; // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need |