mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-6538_ConditionalExecutionReturn'
into Ghidra_12.1 (Closes #9018, Closes #9019)
This commit is contained in:
@@ -336,16 +336,15 @@ void ConditionalExecution::doReplacement(PcodeOp *op)
|
|||||||
if (readop->code() == CPUI_MULTIEQUAL) {
|
if (readop->code() == CPUI_MULTIEQUAL) {
|
||||||
rvn = getMultiequalRead(op, readop, slot);
|
rvn = getMultiequalRead(op, readop, slot);
|
||||||
}
|
}
|
||||||
else if (readop->code() == CPUI_RETURN) { // Cannot replace input of RETURN directly, create COPY to hold input
|
else if (readop->code() == CPUI_RETURN && slot > 0) { // Cannot replace input of RETURN directly, create COPY to hold input
|
||||||
Varnode *retvn = readop->getIn(1);
|
|
||||||
PcodeOp *newcopyop = fd->newOp(1,readop->getAddr());
|
PcodeOp *newcopyop = fd->newOp(1,readop->getAddr());
|
||||||
fd->opSetOpcode(newcopyop,CPUI_COPY);
|
fd->opSetOpcode(newcopyop,CPUI_COPY);
|
||||||
Varnode *outvn = fd->newVarnodeOut(retvn->getSize(),retvn->getAddr(),newcopyop); // Preserve the CPUI_RETURN storage address
|
Varnode *outvn = fd->newVarnodeOut(vn->getSize(),vn->getAddr(),newcopyop); // Preserve the Varnode's storage address
|
||||||
fd->opSetInput(readop,outvn,1);
|
fd->opSetInput(readop,outvn,slot);
|
||||||
fd->opInsertBefore(newcopyop,readop);
|
fd->opInsertBefore(newcopyop,readop);
|
||||||
readop = newcopyop;
|
readop = newcopyop;
|
||||||
slot = 0;
|
slot = 0;
|
||||||
rvn = getReplacementRead(op,bl);
|
rvn = getReplacementRead(op,bl); // COPY gets the replacement read
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rvn = getReplacementRead(op,bl);
|
rvn = getReplacementRead(op,bl);
|
||||||
|
|||||||
Reference in New Issue
Block a user