[llvm-commits] [llvm] r172022 - /llvm/trunk/lib/Object/Archive.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Wed Jan 9 16:07:38 PST 2013
Author: mspencer
Date: Wed Jan 9 18:07:38 2013
New Revision: 172022
URL: http://llvm.org/viewvc/llvm-project?rev=172022&view=rev
Log:
[Object][Archive] Apparently StringRef::getAsInteger for APInt accepts spaces.
Modified:
llvm/trunk/lib/Object/Archive.cpp
Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=172022&r1=172021&r2=172022&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Wed Jan 9 18:07:38 2013
@@ -49,7 +49,7 @@
uint64_t getSize() const {
uint64_t ret;
- StringRef(Size, sizeof(Size)).getAsInteger(10, ret);
+ StringRef(Size, sizeof(Size)).rtrim(" ").getAsInteger(10, ret);
return ret;
}
};
@@ -110,7 +110,7 @@
}
// It's a long name.
// Get the offset.
- uint64_t offset;
+ std::size_t offset;
name.substr(1).getAsInteger(10, offset);
const char *addr = Parent->StringTable->Data.begin()
+ sizeof(ArchiveMemberHeader)
@@ -218,6 +218,10 @@
SymbolTable = i;
StringTable = e;
if (i != e) ++i;
+ if (i == e) {
+ ec = object_error::parse_failed;
+ return;
+ }
if ((ec = i->getName(name)))
return;
if (name[0] != '/') {
More information about the llvm-commits
mailing list