Browse Source

Fix CombineExitsTransform

pull/1405/head
Siegfried Pammer 7 years ago
parent
commit
238b5ac092
  1. 4
      ICSharpCode.Decompiler/IL/Transforms/CombineExitsTransform.cs

4
ICSharpCode.Decompiler/IL/Transforms/CombineExitsTransform.cs

@ -13,11 +13,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -13,11 +13,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms
var block = container.EntryPoint;
if (block.Kind != BlockKind.ControlFlow)
return;
if (!(block.Instructions.SecondToLastOrDefault() is IfInstruction ifInst && block.Instructions.LastOrDefault() is Leave leave))
if (!(block.Instructions.SecondToLastOrDefault() is IfInstruction ifInst && block.Instructions.LastOrDefault() is Leave leave2))
return;
if (!ifInst.FalseInst.MatchNop())
return;
if (!(Block.Unwrap(ifInst.TrueInst) is Leave leave2))
if (!(Block.Unwrap(ifInst.TrueInst) is Leave leave))
return;
if (!(leave.IsLeavingFunction && leave2.IsLeavingFunction))
return;

Loading…
Cancel
Save