Skip to content

Commit c061e27

Browse files
authored
[BUG] Segmentation Fault in user project #473 (#474)
- code examples shows, that `returnType->getPointeeType().getBaseTypeIdentifier()` can be null
1 parent 1dd46ac commit c061e27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/types/TypesResolver.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ void TypesResolver::resolveStructEx(const clang::RecordDecl *D, const std::strin
137137
F->getFunctionType(), field.name, sourceManager,
138138
field.type.isArrayOfPointersToFunction());
139139
auto returnType = F->getFunctionType()->getReturnType();
140-
if (returnType->isPointerType() && returnType->getPointeeType()->isStructureType()) {
140+
if (returnType->isPointerType()
141+
&& returnType->getPointeeType()->isStructureType()
142+
&& returnType->getPointeeType().getBaseTypeIdentifier()) {
141143
std::string structName =
142144
returnType->getPointeeType().getBaseTypeIdentifier()->getName().str();
143145
if (!CollectionUtils::containsKey((*parent->structsDeclared).at(sourceFilePath),

0 commit comments

Comments
 (0)