Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ICSharpCode.Decompiler/DecompilerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ public CSharpFormattingOptions CSharpFormattingOptions {
}
}
}

bool skipLdvirtftnArgumentRemove = false;

public bool SkipLdvirtftnArgumentRemove
{
get { return skipLdvirtftnArgumentRemove; }
set
{
if (skipLdvirtftnArgumentRemove != value)
{
skipLdvirtftnArgumentRemove = value;
OnPropertyChanged("SkipLdvirtftnArgumentRemove");
}
}
}

public event PropertyChangedEventHandler PropertyChanged;

Expand Down
3 changes: 2 additions & 1 deletion ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ void IntroducePropertyAccessInstructions(ILExpression expr, ILExpression parentE
if (expr.Arguments[0].Match(ILCode.Ldloc, out target)
&& expr.Arguments[1].Code == ILCode.Ldvirtftn
&& expr.Arguments[1].Arguments.Count == 1
&& expr.Arguments[1].Arguments[0].MatchLdloc(target))
&& expr.Arguments[1].Arguments[0].MatchLdloc(target)
&& !context.Settings.SkipLdvirtftnArgumentRemove)
{
// Remove the 'target' argument from the ldvirtftn instruction.
// It's not needed in the translation to C#, and needs to be eliminated so that the target expression
Expand Down