From 13250cbb4aa1bc7d9be95f83ed4b8eb31dd52dd3 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 6 Dec 2013 02:33:38 +0000 Subject: Fix a pair of array index checks. Patch by Marius Wachtler. llvm-svn: 196560 --- llvm/lib/Object/MachOObjectFile.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index d2cb8bde6d2..dc0f9ff6b46 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: -- cgit v1.2.3