diff options
| author | Brandon Miller <brandon@vector35.com> | 2025-07-21 11:53:04 -0400 |
|---|---|---|
| committer | Brandon Miller <brandon@vector35.com> | 2025-07-21 15:20:51 -0400 |
| commit | 3ad25553a486681799b0458d4721baa774f7fbf7 (patch) | |
| tree | e189e1fb648a54f60feed1d844bd0464d746b805 /arch/mips | |
| parent | c9f1802f8f5a1b2b0b1d7f40a4140becb61bd193 (diff) | |
Fix crash on R_MIPS_HI16 relocs caused by bad cast
Diffstat (limited to 'arch/mips')
| -rw-r--r-- | arch/mips/arch_mips.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp index 692679ec..6150e578 100644 --- a/arch/mips/arch_mips.cpp +++ b/arch/mips/arch_mips.cpp @@ -2727,10 +2727,6 @@ public: return registers; } - - MipsVersion GetMIPSVersion() { - return m_version; - } }; class MipsO32CallingConvention: public CallingConvention @@ -3412,8 +3408,11 @@ public: uint32_t inst2 = *(uint32_t*)(cur->relocationDataCache); Instruction instruction; memset(&instruction, 0, sizeof(instruction)); - MipsArchitecture& march = dynamic_cast<MipsArchitecture&>(*arch); - if (mips_decompose(&inst2, sizeof(uint32_t), &instruction, march.GetMIPSVersion(), cur->address, arch->GetEndianness(), DECOMPOSE_FLAGS_PSEUDO_OP)) + auto version = arch->GetAddressSize() == 8 ? MIPS_64 : MIPS_32; + if (Architecture::GetByName("r5900l") == arch) + version = MIPS_R5900; + if (mips_decompose(&inst2, sizeof(uint32_t), &instruction, + version, cur->address, arch->GetEndianness(), DECOMPOSE_FLAGS_PSEUDO_OP)) break; int32_t immediate = swap(inst2) & 0xffff; |
