Skip to content

Commit cbf39e0

Browse files
committed
Fix thumb2 lifting to prevent temp reg spillover for post dec stm instruction.
1 parent 4253280 commit cbf39e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/armv7/thumb2_disasm/il_thumb2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,12 +1474,13 @@ bool GetLowLevelILForThumbInstruction(Architecture* arch, LowLevelILFunction& il
14741474
else
14751475
il.AddInstruction(il.SetRegister(4, LLIL_TEMP(0), il.Register(4, baseReg)));
14761476

1477+
uint32_t targetReg = decBeforeMode ? LLIL_TEMP(0) : baseReg;
14771478
for (int32_t i = 0, slot = 0; i <= regLimit; i++)
14781479
{
14791480
if ((regs >> i) & 1)
14801481
{
14811482
il.AddInstruction(il.Store(4,
1482-
il.Add(4, il.Register(4, LLIL_TEMP(0)), il.Const(4, 4 * slot++)),
1483+
il.Add(4, il.Register(4, targetReg), il.Const(4, 4 * slot++)),
14831484
il.Register(4, GetRegisterByIndex(i))));
14841485
}
14851486
}

0 commit comments

Comments
 (0)