MCJIT: Make sure to mask off non-type-field bits.
authorJim Grosbach <grosbach@apple.com>
Thu, 13 Sep 2012 01:24:35 +0000 (01:24 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 13 Sep 2012 01:24:35 +0000 (01:24 +0000)
When comparing to the macho relocation type enum value, make sure we're only
comparing against the bits in the RelType that correspond.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163764 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp

index 73fbda4ab6634dbf85e5ccdca2dc90da4f692c36..4fd7bc99c366f723b9fee800b6d1bd7aca77a1f0 100644 (file)
@@ -254,7 +254,7 @@ void RuntimeDyldMachO::processRelocationRef(const ObjRelocationInfo &Rel,
     }
   }
 
-  if (Arch == Triple::arm && RelType == macho::RIT_ARM_Branch24Bit) {
+  if (Arch == Triple::arm && (RelType & 0xf) == macho::RIT_ARM_Branch24Bit) {
     // This is an ARM branch relocation, need to use a stub function.
 
     //  Look up for existing stub.