mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-04 08:27:50 +00:00
[clangd] Fix use-after-free with expected types in indexing
llvm-svn: 347563
This commit is contained in:
parent
647da3e8a5
commit
4d3d82eef9
@ -587,9 +587,11 @@ const Symbol *SymbolCollector::addDeclaration(const NamedDecl &ND,
|
||||
if (!Include.empty())
|
||||
S.IncludeHeaders.emplace_back(Include, 1);
|
||||
|
||||
llvm::Optional<OpaqueType> TypeStorage;
|
||||
if (S.Flags & Symbol::IndexedForCodeCompletion) {
|
||||
if (auto T = OpaqueType::fromCompletionResult(*ASTCtx, SymbolCompletion))
|
||||
S.Type = T->raw();
|
||||
TypeStorage = OpaqueType::fromCompletionResult(*ASTCtx, SymbolCompletion);
|
||||
if (TypeStorage)
|
||||
S.Type = TypeStorage->raw();
|
||||
}
|
||||
|
||||
S.Origin = Opts.Origin;
|
||||
|
Loading…
x
Reference in New Issue
Block a user