[llvm] 6032ff6 - [CAS] Fix a bug in CAS storeFromOpenFileImpl (#153315)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 12 16:25:18 PDT 2025


Author: Steven Wu
Date: 2025-08-12T23:25:14Z
New Revision: 6032ff6c81844177321bcca827f51489dd80f7d6

URL: https://github.com/llvm/llvm-project/commit/6032ff6c81844177321bcca827f51489dd80f7d6
DIFF: https://github.com/llvm/llvm-project/commit/6032ff6c81844177321bcca827f51489dd80f7d6.diff

LOG: [CAS] Fix a bug in CAS storeFromOpenFileImpl (#153315)

Fix a bug in upstreamed CAS implemenation due to copy/paste error. The
missing coverage will be covered by future upstreamed tests.

Added: 
    

Modified: 
    llvm/lib/CAS/ObjectStore.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CAS/ObjectStore.cpp b/llvm/lib/CAS/ObjectStore.cpp
index b8e8ee1ed3942..e0be50bbe013a 100644
--- a/llvm/lib/CAS/ObjectStore.cpp
+++ b/llvm/lib/CAS/ObjectStore.cpp
@@ -125,7 +125,7 @@ ObjectStore::storeFromOpenFileImpl(sys::fs::file_t FD,
   // standalone file if the file-system supports it and the file is large.
   uint64_t Size = Status ? Status->getSize() : -1;
   auto Buffer = MemoryBuffer::getOpenFile(FD, /*Filename=*/"", Size);
-  if (Buffer)
+  if (!Buffer)
     return errorCodeToError(Buffer.getError());
 
   return store({}, arrayRefFromStringRef<char>((*Buffer)->getBuffer()));


        


More information about the llvm-commits mailing list