aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit13250cbb4aa1bc7d9be95f83ed4b8eb31dd52dd3 (patch)
treef6ab09f59019810faae00343a76a4c91e6ec7385 /llvm/lib/Object/MachOObjectFile.cpp
parent0d62c78c20f874a597b4b0a830e926287aea7412 (diff)
downloadllvm-13250cbb4aa1bc7d9be95f83ed4b8eb31dd52dd3.zip
llvm-13250cbb4aa1bc7d9be95f83ed4b8eb31dd52dd3.tar.gz
llvm-13250cbb4aa1bc7d9be95f83ed4b8eb31dd52dd3.tar.bz2
Fix a pair of array index checks.
Patch by Marius Wachtler. llvm-svn: 196560
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index d2cb8bd..dc0f9ff 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/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: