[llvm] r185936 - Archive members cannot be larger than 4GB. Return a uint32_t.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jul 9 05:45:11 PDT 2013
Author: rafael
Date: Tue Jul 9 07:45:11 2013
New Revision: 185936
URL: http://llvm.org/viewvc/llvm-project?rev=185936&view=rev
Log:
Archive members cannot be larger than 4GB. Return a uint32_t.
Modified:
llvm/trunk/include/llvm/Object/Archive.h
llvm/trunk/lib/Object/Archive.cpp
Modified: llvm/trunk/include/llvm/Object/Archive.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Archive.h?rev=185936&r1=185935&r2=185936&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/Archive.h (original)
+++ llvm/trunk/include/llvm/Object/Archive.h Tue Jul 9 07:45:11 2013
@@ -33,7 +33,8 @@ struct ArchiveMemberHeader {
/// Get the name without looking up long names.
llvm::StringRef getName() const;
- uint64_t getSize() const;
+ /// Members are not larger than 4GB.
+ uint32_t getSize() const;
};
class Archive : public Binary {
Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=185936&r1=185935&r2=185936&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Tue Jul 9 07:45:11 2013
@@ -54,11 +54,11 @@ StringRef ArchiveMemberHeader::getName()
return llvm::StringRef(Name, end);
}
-uint64_t ArchiveMemberHeader::getSize() const {
- uint64_t ret;
- if (llvm::StringRef(Size, sizeof(Size)).rtrim(" ").getAsInteger(10, ret))
- llvm_unreachable("Size is not an integer.");
- return ret;
+uint32_t ArchiveMemberHeader::getSize() const {
+ uint32_t Ret;
+ if (llvm::StringRef(Size, sizeof(Size)).rtrim(" ").getAsInteger(10, Ret))
+ llvm_unreachable("Size is not a decimal number.");
+ return Ret;
}
static const ArchiveMemberHeader *toHeader(const char *base) {
More information about the llvm-commits
mailing list