diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc index 84b7855c20..0f07124895 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc @@ -487,8 +487,9 @@ void Heritage::findAddressForces(vector ©Sinks,vector if (newOp->isMark()) continue; // Already visited this op newOp->setMark(); OpCode opc = newOp->code(); - bool isArtificial = (opc == CPUI_COPY || opc == CPUI_MULTIEQUAL); - if (isArtificial) { + bool isArtificial = false; + if (opc == CPUI_COPY || opc == CPUI_MULTIEQUAL) { + isArtificial = true; int4 maxInNew = newOp->numInput(); for(int4 j=0;jgetIn(j); @@ -498,6 +499,12 @@ void Heritage::findAddressForces(vector ©Sinks,vector } } } + else if (opc == CPUI_INDIRECT && newOp->isIndirectStore()) { + // An INDIRECT can be considered artificial if it is caused by a STORE + Varnode *inVn = newOp->getIn(0); + if (addr == inVn->getAddr()) + isArtificial = true; + } if (isArtificial) copySinks.push_back(newOp); else