Browse Source

Fix ILRange of ILFunction in DelegateConstruction

pull/923/head
Siegfried Pammer 8 years ago
parent
commit
5e50294c82
  1. 4
      ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

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

@ -43,7 +43,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -43,7 +43,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
foreach (var call in block.Instructions[i].Descendants.OfType<NewObj>()) {
ILFunction f = TransformDelegateConstruction(call, out ILInstruction target);
if (f != null) {
call.Arguments[0].ReplaceWith(new Nop());
f.AddILRange(call.Arguments[0].ILRange);
f.AddILRange(call.Arguments[1].ILRange);
call.Arguments[0].ReplaceWith(new LdNull());
call.Arguments[1].ReplaceWith(f);
if (target is IInstructionWithVariableOperand && !target.MatchLdThis())
targetsToReplace.Add((IInstructionWithVariableOperand)target);

Loading…
Cancel
Save