From 185e9e433159c1532790d401b115bd491374cfc8 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 8 Feb 2011 22:54:17 +0100 Subject: [PATCH] Fix decompiling "this". --- ICSharpCode.Decompiler/Ast/AstMetodBodyBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/Ast/AstMetodBodyBuilder.cs b/ICSharpCode.Decompiler/Ast/AstMetodBodyBuilder.cs index fbfa918f0..1802f19cc 100644 --- a/ICSharpCode.Decompiler/Ast/AstMetodBodyBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstMetodBodyBuilder.cs @@ -578,7 +578,7 @@ namespace Decompiler case Code.Isinst: return new Ast.TypeOfIsExpression(arg1, new Ast.TypeReference(((Cecil.TypeReference)operand).FullName)); case Code.Jmp: throw new NotImplementedException(); case Code.Ldarg: - if (methodDef.HasThis && ((ParameterDefinition)operand).Index == 0) { + if (methodDef.HasThis && ((ParameterDefinition)operand).Index < 0) { return new Ast.ThisReferenceExpression(); } else { return new Ast.IdentifierExpression(((ParameterDefinition)operand).Name);