diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2018-07-04 08:50:12 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2018-07-04 08:50:12 +0000 |
commit | c8c9b4da91fdf2e1bd938704f419763a969b56ed (patch) | |
tree | 3ab271057c89c576f7602693c095b6c88c63c377 /lib/Sema/SemaExprCXX.cpp | |
parent | 4f874f4052f3375bfbd0d3a7655ee049d3cccdd8 (diff) |
[Sema] Fix crash in getConstructorName.
Summary:
Can happen when getConstructorName is called on invalid decls,
specifically the ones that do not have the injected class name.
Reviewers: bkramer, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48880
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index db47931348..8dd9c19bd3 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -113,6 +113,8 @@ ParsedType Sema::getConstructorName(IdentifierInfo &II, break; } } + if (!InjectedClassName && CurClass->isInvalidDecl()) + return ParsedType(); assert(InjectedClassName && "couldn't find injected class name"); QualType T = Context.getTypeDeclType(InjectedClassName); |