summaryrefslogtreecommitdiff
path: root/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-12-06 02:33:38 +0000
committerEric Christopher <echristo@gmail.com>2013-12-06 02:33:38 +0000
commita6000643d94425e767f041fcdaa51e90b6f71c84 (patch)
treef60965f7d5ea740623a6ea4ff8c860ca56e69c2b /lib/Object/MachOObjectFile.cpp
parentf8edf9fca9fbfbbabc11d598d6f4e39a346c418a (diff)
downloadllvm-a6000643d94425e767f041fcdaa51e90b6f71c84.tar.gz
llvm-a6000643d94425e767f041fcdaa51e90b6f71c84.tar.bz2
llvm-a6000643d94425e767f041fcdaa51e90b6f71c84.tar.xz
Fix a pair of array index checks.
Patch by Marius Wachtler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/MachOObjectFile.cpp')
-rw-r--r--lib/Object/MachOObjectFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index d2cb8bde6d..dc0f9ff6b4 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/lib/Object/MachOObjectFile.cpp
@@ -899,7 +899,7 @@ MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
"GENERIC_RELOC_LOCAL_SECTDIFF",
"GENERIC_RELOC_TLV" };
- if (RType > 6)
+ if (RType > 5)
res = "Unknown";
else
res = Table[RType];
@@ -962,7 +962,10 @@ MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
"PPC_RELOC_LO14_SECTDIFF",
"PPC_RELOC_LOCAL_SECTDIFF" };
- res = Table[RType];
+ if (RType > 15)
+ res = "Unknown";
+ else
+ res = Table[RType];
break;
}
case Triple::UnknownArch: