[PATCH] D138986: [AIX][BigArchive] Treat the archive is empty if the first child member offset is zero

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 11 18:24:45 PST 2022


lkail updated this revision to Diff 481966.
lkail marked an inline comment as done.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138986/new/

https://reviews.llvm.org/D138986

Files:
  llvm/include/llvm/Object/Archive.h
  llvm/test/Object/archive-big-read-empty-with-freelist.test


Index: llvm/test/Object/archive-big-read-empty-with-freelist.test
===================================================================
--- llvm/test/Object/archive-big-read-empty-with-freelist.test
+++ 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: not llvm-ar tv %p/Inputs/aix-empty-big-archive-with-freelist.a 2>&1 \
-# RUN:   | grep 'truncated or malformed archive'
+# RUN: llvm-ar tv %p/Inputs/aix-empty-big-archive-with-freelist.a 2>&1 \
+# RUN:   | not grep 'truncated or malformed archive'
Index: llvm/include/llvm/Object/Archive.h
===================================================================
--- llvm/include/llvm/Object/Archive.h
+++ llvm/include/llvm/Object/Archive.h
@@ -413,9 +413,7 @@
   BigArchive(MemoryBufferRef Source, Error &Err);
   uint64_t getFirstChildOffset() const override { return FirstChildOffset; }
   uint64_t getLastChildOffset() const { return LastChildOffset; }
-  bool isEmpty() const override {
-    return Data.getBufferSize() == sizeof(FixLenHdr);
-  };
+  bool isEmpty() const override { getFirstChildOffset() == 0; };
 };
 
 } // end namespace object


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138986.481966.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221212/5d1afa62/attachment.bin>


More information about the llvm-commits mailing list