|
|
@ -31,28 +31,16 @@ namespace ICSharpCode.Decompiler.IL.Transforms |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(proxyFunction.Body is BlockContainer blockContainer)) |
|
|
|
if (proxyFunction.Children.Count != 1) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
var blockContainer = proxyFunction.Children[0]; |
|
|
|
|
|
|
|
if (blockContainer.OpCode != OpCode.BlockContainer) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
if (blockContainer.Children.Count != 1) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
var block = blockContainer.Children[0]; |
|
|
|
|
|
|
|
if (block.OpCode != OpCode.Block) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
if (block.Children.Count > 2) |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
if (block.Children.Count == 2 && block.Children[1].OpCode != OpCode.Nop) |
|
|
|
if (blockContainer.Blocks.Count != 1) |
|
|
|
return; |
|
|
|
return; |
|
|
|
var leave = block.Children[0]; |
|
|
|
var block = blockContainer.Blocks[0]; |
|
|
|
if (leave.OpCode != OpCode.Leave) |
|
|
|
if (block.Instructions.Count != 1) |
|
|
|
return; |
|
|
|
return; |
|
|
|
if (leave.Children.Count != 1) |
|
|
|
if (!block.Instructions[0].MatchLeave(blockContainer, out ILInstruction returnValue)) |
|
|
|
return; |
|
|
|
return; |
|
|
|
Call call = leave.Children[0] as Call; |
|
|
|
if (!(returnValue is Call call)) |
|
|
|
if (call == null) |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
// check if original arguments are only correct ldloc calls
|
|
|
|
// check if original arguments are only correct ldloc calls
|
|
|
|
for (int i = 0; i < call.Arguments.Count; i++) { |
|
|
|
for (int i = 0; i < call.Arguments.Count; i++) { |
|
|
|