From d26fb9911e99c29436f84e348c35623cf6f9dca0 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:29:31 -0400 Subject: [PATCH] GP-3700: Fix indirect branching operand size mismatch. --- .../src/main/java/ghidra/pcode/exec/PcodeExecutor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/PcodeExecutor.java b/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/PcodeExecutor.java index 0e52acdeee..a5ce01bc07 100644 --- a/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/PcodeExecutor.java +++ b/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/PcodeExecutor.java @@ -411,7 +411,9 @@ public class PcodeExecutor { * @param frame the frame to finish */ protected void branchToOffset(T offset, PcodeFrame frame) { - state.setVar(pc, offset); + T truncOff = arithmetic.unaryOp(PcodeOp.COPY, pc.getMinimumByteSize(), + (int) arithmetic.sizeOf(offset), offset); + state.setVar(pc, truncOff); frame.finishAsBranch(); }