From f8d7b704df457fe5a10e6bb9766e7bb34db3e98e Mon Sep 17 00:00:00 2001 From: caheckman <48068198+caheckman@users.noreply.github.com> Date: Tue, 4 Nov 2025 20:44:18 +0000 Subject: [PATCH] GP-6090 Adjustment for duplicate inputs in pushMultiequal --- .../src/decompile/cpp/funcdata_block.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc index 9c01a58557..29d08d2fea 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc @@ -157,12 +157,15 @@ void Funcdata::pushMultiequals(BlockBasic *bb) list::iterator titer = origvn->descend.begin(); while(titer != origvn->descend.end()) { PcodeOp *op = *titer++; - i = op->getSlot(origvn); - // Do not replace MULTIEQUAL references in the same block - // as replaceop. These are patched by block_remove - if ((op->code()==CPUI_MULTIEQUAL)&&(op->getParent()==outblock)&&(i==outblock_ind)) - continue; - opSetInput(op,replacevn,i); + for(i=0;inumInput();++i) { + if (op->getIn(i) != origvn) + continue; + if (i == outblock_ind && op->getParent() == outblock && op->code() == CPUI_MULTIEQUAL) { + continue; + } + opSetInput(op,replacevn,i); + break; + } } } }