mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-16 16:06:05 +00:00
[clangd] Fixed null deference on invalid compile commands.
Code building the AST expected that construction of CompilerInstance always succeeds. This is not the case. llvm-svn: 323652
This commit is contained in:
parent
4f321aef74
commit
cec6335f35
@ -244,6 +244,8 @@ ParsedAST::Build(const Context &Ctx,
|
||||
auto Clang = prepareCompilerInstance(
|
||||
std::move(CI), PreamblePCH, std::move(Buffer), std::move(PCHs),
|
||||
std::move(VFS), /*ref*/ UnitDiagsConsumer);
|
||||
if (!Clang)
|
||||
return llvm::None;
|
||||
|
||||
// Recover resources if we crash before exiting this method.
|
||||
llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> CICleanup(
|
||||
|
Loading…
x
Reference in New Issue
Block a user