Browse Source

DelegateConstruction: Fix bug in that prevented all display class references from being removed.

pull/892/merge
Siegfried Pammer 8 years ago
parent
commit
43f3b006a3
  1. 4
      ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

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

@ -46,10 +46,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -46,10 +46,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (f != null) {
call.Arguments[0].ReplaceWith(new Nop());
call.Arguments[1].ReplaceWith(f);
}
if (target is IInstructionWithVariableOperand && !target.MatchLdThis())
targetsToReplace.Add((IInstructionWithVariableOperand)target);
}
}
ILVariable targetVariable;
ILInstruction value;
@ -290,7 +290,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -290,7 +290,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
base.VisitLdObj(inst);
ILInstruction target;
IField field;
if (!inst.Target.MatchLdFlda(out target, out field) || !MatchesTargetOrCopyLoad(target))
if (!inst.Target.MatchLdFlda(out target, out field))
return;
DisplayClassVariable info;
if (!initValues.TryGetValue((IField)field.MemberDefinition, out info))

Loading…
Cancel
Save