Skip to content

Commit 1503a15

Browse files
authored
Merge pull request #7326 from akyrtzi/akyrtzi/pr/stable-fix-ubsan
[clang/CompileJobCache] Fix UBSan issue
2 parents cce90ed + 2282144 commit 1503a15

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
@@ -78,7 +78,8 @@ class ObjectStoreCachingOutputs : public CompileJobCache::CachingOutputs {
7878
std::shared_ptr<llvm::cas::ActionCache> Cache)
7979
: CachingOutputs(Clang, std::move(Mapper)), CAS(std::move(DB)),
8080
Cache(std::move(Cache)) {
81-
CASOutputs = llvm::makeIntrusiveRefCnt<llvm::cas::CASOutputBackend>(*CAS);
81+
if (CAS)
82+
CASOutputs = llvm::makeIntrusiveRefCnt<llvm::cas::CASOutputBackend>(*CAS);
8283
}
8384

8485
Expected<std::optional<int>>

0 commit comments

Comments
 (0)