diff --git a/src/backend/x64/a32_emit_x64.cpp b/src/backend/x64/a32_emit_x64.cpp index 61d5fba7..887ad583 100644 --- a/src/backend/x64/a32_emit_x64.cpp +++ b/src/backend/x64/a32_emit_x64.cpp @@ -67,6 +67,10 @@ A32::LocationDescriptor A32EmitContext::Location() const { return A32::LocationDescriptor{block.Location()}; } +A32::LocationDescriptor A32EmitContext::EndLocation() const { + return A32::LocationDescriptor{block.EndLocation()}; +} + bool A32EmitContext::IsSingleStep() const { return Location().SingleStepping(); } @@ -732,7 +736,7 @@ void A32EmitX64::EmitA32BXWritePC(A32EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto& arg = args[0]; - const u32 upper_without_t = (ctx.Location().SetSingleStepping(false).UniqueHash() >> 32) & 0xFFFFFFFE; + const u32 upper_without_t = (ctx.EndLocation().SetSingleStepping(false).UniqueHash() >> 32) & 0xFFFFFFFE; // Pseudocode: // if (new_pc & 1) { diff --git a/src/backend/x64/a32_emit_x64.h b/src/backend/x64/a32_emit_x64.h index a946e49f..f9056bb8 100644 --- a/src/backend/x64/a32_emit_x64.h +++ b/src/backend/x64/a32_emit_x64.h @@ -29,6 +29,7 @@ struct A32EmitContext final : public EmitContext { A32EmitContext(const A32::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block); A32::LocationDescriptor Location() const; + A32::LocationDescriptor EndLocation() const; bool IsSingleStep() const; FP::FPCR FPCR(bool fpcr_controlled = true) const override;