From f96036b3f1a2652934ff2434e22c95ecc4f2a11b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 27 Apr 2019 17:22:30 -0400 Subject: [PATCH] A32/barrier: Correct PC assignment within ISB The SetRegister() IR function doesn't allow specifying the PC as a register. This is a discrepancy that slipped through (my bad). Instead, we can use BranchWritePC(), like how the other similar PC modifying locations do it. --- src/frontend/A32/translate/translate_arm/barrier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/A32/translate/translate_arm/barrier.cpp b/src/frontend/A32/translate/translate_arm/barrier.cpp index 2f4a53a4..5ae3eba9 100644 --- a/src/frontend/A32/translate/translate_arm/barrier.cpp +++ b/src/frontend/A32/translate/translate_arm/barrier.cpp @@ -20,7 +20,7 @@ bool ArmTranslatorVisitor::arm_DSB([[maybe_unused]] Imm4 option) { bool ArmTranslatorVisitor::arm_ISB([[maybe_unused]] Imm4 option) { ir.InstructionSynchronizationBarrier(); - ir.SetRegister(Reg::PC, ir.Imm32(ir.current_location.PC() + 4)); + ir.BranchWritePC(ir.Imm32(ir.current_location.PC() + 4)); ir.SetTerm(IR::Term::ReturnToDispatch{}); return false; }