From fb2b9fb894b6c9be8a290bdf69c29f0f5511ba3c Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Wed, 18 Jun 2014 22:04:40 +0000 Subject: Teach llvm-size to know about Mach-O universal files (aka fat files) and fat files containing archives. Also fix a bug in MachOUniversalBinary::ObjectForArch::ObjectForArch() where it needed a >= when comparing the Index with the number of objects in a fat file. As the index starts at 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211230 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/MachOUniversal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Object') diff --git a/lib/Object/MachOUniversal.cpp b/lib/Object/MachOUniversal.cpp index e414de8bcf..05729ef746 100644 --- a/lib/Object/MachOUniversal.cpp +++ b/lib/Object/MachOUniversal.cpp @@ -53,7 +53,7 @@ static T getUniversalBinaryStruct(const char *Ptr) { MachOUniversalBinary::ObjectForArch::ObjectForArch( const MachOUniversalBinary *Parent, uint32_t Index) : Parent(Parent), Index(Index) { - if (!Parent || Index > Parent->getNumberOfObjects()) { + if (!Parent || Index >= Parent->getNumberOfObjects()) { clear(); } else { // Parse object header. -- cgit v1.2.3