Skip to content

Commit 42d3f32

Browse files
committed
Revert "[AIX][BigArchive] Treat the archive is empty if the first child member offset is zero"
This reverts commit b26fe2a. Reason: Broke the ASan build bots. See more info in the original phabricator review: https://reviews.llvm.org/D138986
1 parent 975fa72 commit 42d3f32

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

llvm/include/llvm/Object/Archive.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ class BigArchive : public Archive {
413413
BigArchive(MemoryBufferRef Source, Error &Err);
414414
uint64_t getFirstChildOffset() const override { return FirstChildOffset; }
415415
uint64_t getLastChildOffset() const { return LastChildOffset; }
416-
bool isEmpty() const override { return getFirstChildOffset() == 0; }
416+
bool isEmpty() const override {
417+
return Data.getBufferSize() == sizeof(FixLenHdr);
418+
};
417419
};
418420

419421
} // end namespace object

llvm/test/Object/archive-big-malformed-first-member.test

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Test reading an empty archive with free list in it.
2-
# RUN: llvm-ar tv %p/Inputs/aix-empty-big-archive-with-freelist.a 2>&1 \
3-
# RUN: | not grep 'truncated or malformed archive'
2+
# RUN: not llvm-ar tv %p/Inputs/aix-empty-big-archive-with-freelist.a 2>&1 \
3+
# RUN: | grep 'truncated or malformed archive'

0 commit comments

Comments
 (0)