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

Loading…
Cancel
Save