Skip to content

Commit 5441e0c

Browse files
author
git apple-llvm automerger
committed
Merge commit 'f3ac3ff2771d' from swift/release/6.2 into stable/20240723
2 parents 92ff4b0 + f3ac3ff commit 5441e0c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

llvm/lib/CAS/OnDiskGraphDB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ Error OnDiskGraphDB::validate(bool Deep, HashingFuncT Hasher) const {
966966
llvm_unreachable("already handled");
967967
case TrieRecord::StorageKind::DataPool: {
968968
auto DataRecord = DataRecordHandle::get(DataPool.beginData(D.Offset));
969-
if (DataRecord.getTotalSize() + D.Offset.get() >= DataPool.size())
969+
if (DataRecord.getTotalSize() + D.Offset.get() > DataPool.size())
970970
return dataError("data record span passed the end of the data pool");
971971
for (auto InternRef : DataRecord.getRefs()) {
972972
auto Index = getIndexProxyFromRef(InternRef);

llvm/test/tools/llvm-cas/validation.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
RUN: rm -rf %t
22
RUN: mkdir %t
33

4+
# Ingest a blob which just fits inside the CAS data pool to make sure the validate passes.
5+
RUN: truncate -s 7 %t/file
6+
RUN: cat %t/file | \
7+
RUN: llvm-cas --cas %t/cas --make-blob \
8+
RUN: --data -
9+
RUN: llvm-cas --cas %t/cas --validate --check-hash
10+
411
RUN: llvm-cas --cas %t/cas --ingest %S/Inputs > %t/cas.id
512
RUN: llvm-cas --cas %t/cas --validate
613
RUN: llvm-cas --cas %t/cas --validate --check-hash

0 commit comments

Comments
 (0)