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
var block = container.EntryPoint; var block = container.EntryPoint;
if (block.Kind != BlockKind.ControlFlow) if (block.Kind != BlockKind.ControlFlow)
return; 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; return;
if (!ifInst.FalseInst.MatchNop()) if (!ifInst.FalseInst.MatchNop())
return; return;
if (!(Block.Unwrap(ifInst.TrueInst) is Leave leave2)) if (!(Block.Unwrap(ifInst.TrueInst) is Leave leave))
return; return;
if (!(leave.IsLeavingFunction && leave2.IsLeavingFunction)) if (!(leave.IsLeavingFunction && leave2.IsLeavingFunction))
return; return;

Loading…
Cancel
Save