Skip to content

Commit

Permalink
[BUG] Segmentation Fault in user project #473 (#474)
Browse files Browse the repository at this point in the history
- code examples shows, that `returnType->getPointeeType().getBaseTypeIdentifier()` can be null
  • Loading branch information
alexey-utkin authored Sep 26, 2022
1 parent 1dd46ac commit c061e27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/types/TypesResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ void TypesResolver::resolveStructEx(const clang::RecordDecl *D, const std::strin
F->getFunctionType(), field.name, sourceManager,
field.type.isArrayOfPointersToFunction());
auto returnType = F->getFunctionType()->getReturnType();
if (returnType->isPointerType() && returnType->getPointeeType()->isStructureType()) {
if (returnType->isPointerType()
&& returnType->getPointeeType()->isStructureType()
&& returnType->getPointeeType().getBaseTypeIdentifier()) {
std::string structName =
returnType->getPointeeType().getBaseTypeIdentifier()->getName().str();
if (!CollectionUtils::containsKey((*parent->structsDeclared).at(sourceFilePath),
Expand Down

0 comments on commit c061e27

Please sign in to comment.