diff --git a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h index 274c5523011..196fa62a0a0 100644 --- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h +++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h @@ -183,8 +183,8 @@ public: assert(isInt<33>(Addend) && "Invalid page reloc value."); // Encode the addend into the instruction. - uint32_t ImmLoValue = (uint32_t)(Addend << 17) & 0x60000000; - uint32_t ImmHiValue = (uint32_t)(Addend >> 9) & 0x00FFFFE0; + uint32_t ImmLoValue = ((uint64_t)Addend << 17) & 0x60000000; + uint32_t ImmHiValue = ((uint64_t)Addend >> 9) & 0x00FFFFE0; *p = (*p & 0x9F00001F) | ImmHiValue | ImmLoValue; break; }