mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
Merge remote-tracking branch 'origin/GP-4899_DoNothingSwitchTarget' into
patch (Closes #6819)
This commit is contained in:
commit
1c0396d590
@ -2574,9 +2574,16 @@ bool BlockBasic::isDoNothing(void) const
|
|||||||
if (sizeIn() == 0) return false; // A block that does nothing but
|
if (sizeIn() == 0) return false; // A block that does nothing but
|
||||||
// is a starting block, may need to be a
|
// is a starting block, may need to be a
|
||||||
// placeholder for global(persistent) vars
|
// placeholder for global(persistent) vars
|
||||||
if ((sizeIn()==1)&&(getIn(0)->isSwitchOut())) {
|
for(int4 i=0;i<sizeIn();++i) {
|
||||||
if (getOut(0)->sizeIn() > 1)
|
const FlowBlock *switchbl = getIn(i);
|
||||||
return false; // Don't remove switch targets
|
if (!switchbl->isSwitchOut()) continue;
|
||||||
|
if (switchbl->sizeOut() > 1) {
|
||||||
|
// This block is a switch target
|
||||||
|
if (getOut(0)->sizeIn() > 1) { // Multiple edges coming together
|
||||||
|
// Switch edge may still be propagating a unique value
|
||||||
|
return false; // Don't remove it
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PcodeOp *lastop = lastOp();
|
PcodeOp *lastop = lastOp();
|
||||||
if ((lastop != (PcodeOp *)0)&&(lastop->code()==CPUI_BRANCHIND))
|
if ((lastop != (PcodeOp *)0)&&(lastop->code()==CPUI_BRANCHIND))
|
||||||
|
Loading…
Reference in New Issue
Block a user