translate_thumb: Read-after-write in thumb16_BLX_reg
When the instruction BLX LR is translated, BXWritePC(GetRegister(Reg::LR)) was executed after the SetRegister(Reg::LR, _) update was performed.
This commit is contained in:
parent
20e253ece2
commit
d8bee60947
1 changed files with 1 additions and 1 deletions
|
@ -763,8 +763,8 @@ struct ThumbTranslatorVisitor final {
|
||||||
bool thumb16_BLX_reg(Reg m) {
|
bool thumb16_BLX_reg(Reg m) {
|
||||||
// BLX <Rm>
|
// BLX <Rm>
|
||||||
ir.PushRSB(ir.current_location.AdvancePC(2));
|
ir.PushRSB(ir.current_location.AdvancePC(2));
|
||||||
ir.SetRegister(Reg::LR, ir.Imm32((ir.current_location.PC() + 2) | 1));
|
|
||||||
ir.BXWritePC(ir.GetRegister(m));
|
ir.BXWritePC(ir.GetRegister(m));
|
||||||
|
ir.SetRegister(Reg::LR, ir.Imm32((ir.current_location.PC() + 2) | 1));
|
||||||
ir.SetTerm(IR::Term::ReturnToDispatch{});
|
ir.SetTerm(IR::Term::ReturnToDispatch{});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue