diff options
| author | Mason Reed <mason@vector35.com> | 2024-08-22 18:26:19 -0400 |
|---|---|---|
| committer | mason <35282038+emesare@users.noreply.github.com> | 2024-08-27 11:16:59 -0700 |
| commit | f8218903868c0822d986a0ea43024420ccd6016d (patch) | |
| tree | ea4efceb7f4f985431a7af461703fbbf85957c3b | |
| parent | 5423223b35a6bedfad8a9eaa920b20135dcac801 (diff) | |
Fix non R register groups referencing PC for 15th register index
Any usage of d15, s15, q15 was completely broken
| -rw-r--r-- | arch/armv7/thumb2_disasm/il_thumb2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/armv7/thumb2_disasm/il_thumb2.cpp b/arch/armv7/thumb2_disasm/il_thumb2.cpp index 0387f40f..7dbad75a 100644 --- a/arch/armv7/thumb2_disasm/il_thumb2.cpp +++ b/arch/armv7/thumb2_disasm/il_thumb2.cpp @@ -37,7 +37,7 @@ static uint32_t RegisterSizeFromPrefix(const char* prefix = "") static ExprId ReadRegister(LowLevelILFunction& il, decomp_result* instr, uint32_t reg, size_t size = 4, const char* prefix = "") { - if (reg == armv7::REG_PC) + if (reg == armv7::REG_PC && strcmp(prefix, "") == 0) return il.ConstPointer(size, instr->pc); return il.Register(RegisterSizeFromPrefix(prefix), GetRegisterByIndex(reg, prefix)); } @@ -116,7 +116,7 @@ static ExprId ReadILOperand(LowLevelILFunction& il, decomp_result* instr, size_t return il.Const(size, 0); case OPERAND_FORMAT_REG: value = instr->fields[instr->format->operands[operand].field0]; - return ReadRegister(il, instr, GetRegisterByIndex(value), size); + return ReadRegister(il, instr, GetRegisterByIndex(value), size, instr->format->operands[operand].prefix); case OPERAND_FORMAT_REG_FP: value = instr->fields[instr->format->operands[operand].field0]; return ReadRegister(il, instr, value, size, instr->format->operands[operand].prefix); |
