From c061e278726a9049644b6876c5f23a632c593d2c Mon Sep 17 00:00:00 2001 From: Alexey Utkin Date: Mon, 26 Sep 2022 18:55:50 +0300 Subject: [PATCH] [BUG] Segmentation Fault in user project #473 (#474) - code examples shows, that `returnType->getPointeeType().getBaseTypeIdentifier()` can be null --- server/src/types/TypesResolver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/types/TypesResolver.cpp b/server/src/types/TypesResolver.cpp index dc6eb459a..3effaaa60 100644 --- a/server/src/types/TypesResolver.cpp +++ b/server/src/types/TypesResolver.cpp @@ -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),