[PATCH] D46214: Avoid reading past end of archive looking for long file name

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 28 10:53:14 PDT 2018


inglorion added inline comments.


================
Comment at: llvm/lib/Object/Archive.cpp:186
+      if (End == StringRef::npos)
+        End = ST.size();
+      return StringRef(Start, End - StringOffset - 1);
----------------
espindola wrote:
> This should be an error, no?
Not as I understand it. If I understand the GNU format correctly, all long filenames end in a slash, but newline is only used as a separator, meaning the last file doesn't get one. So the name is delimited either by "/\n" or by "/" <EOF>.


https://reviews.llvm.org/D46214





More information about the llvm-commits mailing list