Skip to content

Commit f7cd52a

Browse files
committed
[clang/CompileJobCache] Fix UBSan issue
1 parent e082f20 commit f7cd52a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Frontend/CompileJobCache.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ class ObjectStoreCachingOutputs : public CompileJobCache::CachingOutputs {
8787
UseCASBackend),
8888
ComputedJobNeedsReplay(WriteOutputAsCASID || UseCASBackend),
8989
MCOutputID(MCOutputID), CAS(std::move(DB)), Cache(std::move(Cache)) {
90-
CASOutputs = llvm::makeIntrusiveRefCnt<llvm::cas::CASOutputBackend>(*CAS);
90+
if (CAS)
91+
CASOutputs = llvm::makeIntrusiveRefCnt<llvm::cas::CASOutputBackend>(*CAS);
9192
}
9293

9394
Expected<std::optional<int>>

0 commit comments

Comments
 (0)