diff --git a/clang/lib/Frontend/CompileJobCache.cpp b/clang/lib/Frontend/CompileJobCache.cpp index 048edec9c38c5a..8f279aa324eb6b 100644 --- a/clang/lib/Frontend/CompileJobCache.cpp +++ b/clang/lib/Frontend/CompileJobCache.cpp @@ -87,7 +87,8 @@ class ObjectStoreCachingOutputs : public CompileJobCache::CachingOutputs { UseCASBackend), ComputedJobNeedsReplay(WriteOutputAsCASID || UseCASBackend), MCOutputID(MCOutputID), CAS(std::move(DB)), Cache(std::move(Cache)) { - CASOutputs = llvm::makeIntrusiveRefCnt(*CAS); + if (CAS) + CASOutputs = llvm::makeIntrusiveRefCnt(*CAS); } Expected>