forked from OSchip/llvm-project
[Analyzer][NoUncountedMembersChecker] Fix crash for C structs
Fixes https://bugs.llvm.org/show_bug.cgi?id=46177 Fixes second bug reported in https://bugs.llvm.org/show_bug.cgi?id=46142
This commit is contained in:
parent
3d40c75189
commit
a95c08db12
|
@ -109,7 +109,11 @@ public:
|
|||
|
||||
// Ref-counted smartpointers actually have raw-pointer to uncounted type as
|
||||
// a member but we trust them to handle it correctly.
|
||||
return isRefCounted(llvm::dyn_cast_or_null<CXXRecordDecl>(RD));
|
||||
auto CXXRD = llvm::dyn_cast_or_null<CXXRecordDecl>(RD);
|
||||
if (CXXRD)
|
||||
return isRefCounted(CXXRD);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void reportBug(const FieldDecl *Member, const Type *MemberType,
|
||||
|
|
Loading…
Reference in New Issue