Browse Source

Ignore non-void leave in ConditionDetection.

This fixes a slight regression in control flow prettyness introduced in 206cdecf30
pull/863/head
Daniel Grunwald 8 years ago
parent
commit
513a01e4dd
  1. 8
      ICSharpCode.Decompiler/IL/ControlFlow/ConditionDetection.cs

8
ICSharpCode.Decompiler/IL/ControlFlow/ConditionDetection.cs

@ -332,10 +332,12 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
private bool IsBranchOrLeave(ILInstruction inst) private bool IsBranchOrLeave(ILInstruction inst)
{ {
switch (inst.OpCode) { switch (inst) {
case OpCode.Branch: case Branch branch:
case OpCode.Leave:
return true; return true;
case Leave leave:
// only void returns are supported as 'exit points'
return !leave.Value.MatchNop();
default: default:
return false; return false;
} }

Loading…
Cancel
Save