[llvm] 42d3f32 - Revert "[AIX][BigArchive] Treat the archive is empty if the first child member offset is zero"
Mitch Phillips via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 19 11:07:33 PST 2022
Author: Mitch Phillips
Date: 2022-12-19T11:06:34-08:00
New Revision: 42d3f326d5d80a6ceeaee2ddad20d250b370f89c
URL: https://github.com/llvm/llvm-project/commit/42d3f326d5d80a6ceeaee2ddad20d250b370f89c
DIFF: https://github.com/llvm/llvm-project/commit/42d3f326d5d80a6ceeaee2ddad20d250b370f89c.diff
LOG: Revert "[AIX][BigArchive] Treat the archive is empty if the first child member offset is zero"
This reverts commit b26fe2a3e520a520e785dc6b4e5758b7fde6af9d.
Reason: Broke the ASan build bots. See more info in the original
phabricator review: https://reviews.llvm.org/D138986
Added:
Modified:
llvm/include/llvm/Object/Archive.h
llvm/test/Object/archive-big-read-empty-with-freelist.test
Removed:
llvm/test/Object/archive-big-malformed-first-member.test
################################################################################
diff --git a/llvm/include/llvm/Object/Archive.h b/llvm/include/llvm/Object/Archive.h
index 56019ee8b8cb5..f5b9fca2816df 100644
--- a/llvm/include/llvm/Object/Archive.h
+++ b/llvm/include/llvm/Object/Archive.h
@@ -413,7 +413,9 @@ class BigArchive : public Archive {
BigArchive(MemoryBufferRef Source, Error &Err);
uint64_t getFirstChildOffset() const override { return FirstChildOffset; }
uint64_t getLastChildOffset() const { return LastChildOffset; }
- bool isEmpty() const override { return getFirstChildOffset() == 0; }
+ bool isEmpty() const override {
+ return Data.getBufferSize() == sizeof(FixLenHdr);
+ };
};
} // end namespace object
diff --git a/llvm/test/Object/archive-big-malformed-first-member.test b/llvm/test/Object/archive-big-malformed-first-member.test
deleted file mode 100644
index 9107bdb6d9d20..0000000000000
--- a/llvm/test/Object/archive-big-malformed-first-member.test
+++ /dev/null
@@ -1,4 +0,0 @@
-# Test reading an empty archive with first member's offset is not zero.
-# RUN: echo "<bigaf>" > %t.a
-# RUN: echo -n "0 0 0 128 0 0 " >> %t.a
-# RUN: not llvm-ar tv %t.a 2>&1 | grep 'truncated or malformed archive'
diff --git a/llvm/test/Object/archive-big-read-empty-with-freelist.test b/llvm/test/Object/archive-big-read-empty-with-freelist.test
index 05e45ca51c39e..2ac3253446597 100644
--- a/llvm/test/Object/archive-big-read-empty-with-freelist.test
+++ b/llvm/test/Object/archive-big-read-empty-with-freelist.test
@@ -1,3 +1,3 @@
# Test reading an empty archive with free list in it.
-# RUN: llvm-ar tv %p/Inputs/aix-empty-big-archive-with-freelist.a 2>&1 \
-# RUN: | not grep 'truncated or malformed archive'
+# RUN: not llvm-ar tv %p/Inputs/aix-empty-big-archive-with-freelist.a 2>&1 \
+# RUN: | grep 'truncated or malformed archive'
More information about the llvm-commits
mailing list