From 38b72df2809c30188a64c94a0016b07272716f68 Mon Sep 17 00:00:00 2001 From: caheckman <48068198+caheckman@users.noreply.github.com> Date: Thu, 5 Mar 2020 11:33:41 -0500 Subject: [PATCH] Truncation amount was not expressed in bytes --- Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc index 42d1b44312..2384ad922b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc @@ -478,7 +478,7 @@ bool SubvariableFlow::traceForward(ReplaceVarnode *rvn) newmask = (rvn->mask >> sa) & calc_mask(outvn->getSize()); if (newmask == 0) break; // subvar is set to zero, truncate flow if (rvn->mask != (newmask << sa)) { // Some kind of truncation of the logical value - if (flowsize > (sa + outvn->getSize()) && (rvn->mask & 1) != 0) { + if (flowsize > ((sa/8) + outvn->getSize()) && (rvn->mask & 1) != 0) { // Only a piece of the logical value remains addTerminalPatchSameOp(op, rvn, 0); hcount += 1;