[PATCH] D13989: This removes the eating of the error in Archive::Child::getSize() when the charactersin the size field in the archive header for the member is not a number.

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 09:30:02 PDT 2015


rafael added inline comments.

================
Comment at: include/llvm/Object/Archive.h:111
@@ -109,3 +110,3 @@
   class child_iterator {
-    Child child;
+    ErrorOr<Child> child;
 
----------------
I don't think the iterator should include the possibility of being at error. Everywhere else we just push the error outwards.

This should still be just "Child child;" and then when appropriate we should use a ErrorOr<child_iterator>. For example, child_begin should return that.

================
Comment at: lib/Object/Archive.cpp:181
@@ -180,3 +201,1 @@
     if (name.substr(1).rtrim(" ").getAsInteger(10, offset))
-      llvm_unreachable("Long name offset is not an integer");
-    const char *addr = Parent->StringTable->Data.begin()
----------------
This changes are nice but independent. Please leave them for another path.


http://reviews.llvm.org/D13989





More information about the llvm-commits mailing list