Update isBranchBlock() method

This commit is contained in:
de4dot 2011-10-20 05:43:01 +02:00
parent 9df4a6c9d2
commit 8e83bc22f2

View File

@ -204,9 +204,18 @@ namespace de4dot.blocks.cflow {
}
bool isBranchBlock(Block block) {
if (block.FallThrough != null)
return block.Targets == null || block.Targets.Count == 0;
return block.Targets != null && block.Targets.Count == 1;
if (block.Targets != null)
return false;
if (block.FallThrough == null)
return false;
switch (block.LastInstr.OpCode.Code) {
case Code.Switch:
case Code.Leave:
case Code.Leave_S:
return false;
default:
return true;
}
}
Block getSwitchTarget(IList<Block> targets, Block fallThrough, Block source, Value value) {