Browse Source

Minor fix in variable naming (Unable to cast object of type 'Decompiler.ILVariable' to type 'Mono.Cecil.ParameterDefinition')

pull/37/head
David Srbecký 15 years ago
parent
commit
5c8f11eaab
  1. 2
      ICSharpCode.Decompiler/Ast/NameVariables.cs

2
ICSharpCode.Decompiler/Ast/NameVariables.cs

@ -97,7 +97,7 @@ namespace Decompiler @@ -97,7 +97,7 @@ namespace Decompiler
switch (expr.Code) {
case ILCode.Ldfld:
// Use the field name only if it's not a field on this (avoid confusion between local variables and fields)
if (!(expr.Arguments[0].Code == ILCode.Ldloc && ((ParameterDefinition)expr.Arguments[0].Operand).Index < 0))
if (!(expr.Arguments[0].Code == ILCode.Ldarg && ((ParameterDefinition)expr.Arguments[0].Operand).Index < 0))
return ((FieldReference)expr.Operand).Name;
break;
case ILCode.Ldsfld:

Loading…
Cancel
Save