diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp index 0e4dc9ad7b..e45f31ed6d 100644 --- a/arch/mips/arch_mips.cpp +++ b/arch/mips/arch_mips.cpp @@ -3503,10 +3503,8 @@ class MipsElfRelocationHandler: public RelocationHandler uint32_t ahl = ((inst & 0xffff) << 16) + immediate; // ((AHL + S) – (short)(AHL + S)) >> 16 - dest32[0] = swap((uint32_t)( - (inst & ~0xffff) | - (((ahl + target) - (short)(ahl + target)) >> 16) - )); + uint32_t hi = ((ahl + target) - (short)(ahl + target)) >> 16; + dest32[0] = swap((inst & ~0xffff) | (hi & 0xffff)); } else {