|
|
@ -162,6 +162,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Replaces loads of 'this' with the target expression.
|
|
|
|
/// Replaces loads of 'this' with the target expression.
|
|
|
|
|
|
|
|
/// Async delegates use: ldobj(ldloca this).
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
class ReplaceDelegateTargetVisitor : ILVisitor |
|
|
|
class ReplaceDelegateTargetVisitor : ILVisitor |
|
|
|
{ |
|
|
|
{ |
|
|
@ -183,12 +184,21 @@ namespace ICSharpCode.Decompiler.IL.Transforms |
|
|
|
|
|
|
|
|
|
|
|
protected internal override void VisitLdLoc(LdLoc inst) |
|
|
|
protected internal override void VisitLdLoc(LdLoc inst) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (inst.MatchLdLoc(thisVariable)) { |
|
|
|
if (inst.Variable == thisVariable) { |
|
|
|
inst.ReplaceWith(target.Clone()); |
|
|
|
inst.ReplaceWith(target.Clone()); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
base.VisitLdLoc(inst); |
|
|
|
base.VisitLdLoc(inst); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected internal override void VisitLdObj(LdObj inst) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (inst.Target.MatchLdLoca(thisVariable)) { |
|
|
|
|
|
|
|
inst.ReplaceWith(target.Clone()); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
base.VisitLdObj(inst); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|