A32/thumb16: Fix bug in CBZ/CBNZ
This commit is contained in:
parent
5918cd48e6
commit
ac9e1ccb1c
1 changed files with 1 additions and 2 deletions
|
@ -879,9 +879,8 @@ bool ThumbTranslatorVisitor::thumb16_CBZ_CBNZ(bool nonzero, Imm<1> i, Imm<5> imm
|
||||||
ir.SetCheckBit(ir.IsZero(rn));
|
ir.SetCheckBit(ir.IsZero(rn));
|
||||||
|
|
||||||
const auto [cond_pass, cond_fail] = [this, imm, nonzero] {
|
const auto [cond_pass, cond_fail] = [this, imm, nonzero] {
|
||||||
const u32 target = ir.PC() + imm;
|
|
||||||
const auto skip = IR::Term::LinkBlock{ir.current_location.AdvancePC(2)};
|
const auto skip = IR::Term::LinkBlock{ir.current_location.AdvancePC(2)};
|
||||||
const auto branch = IR::Term::LinkBlock{ir.current_location.AdvancePC(target)};
|
const auto branch = IR::Term::LinkBlock{ir.current_location.AdvancePC(imm + 4)};
|
||||||
|
|
||||||
if (nonzero) {
|
if (nonzero) {
|
||||||
return std::make_pair(skip, branch);
|
return std::make_pair(skip, branch);
|
||||||
|
|
Loading…
Reference in a new issue