Permalink
Browse files

Pass field names through CleanUpVariableName before using them as var…

…iable names.
  • Loading branch information...
1 parent e31a896 commit d07a28093d11da2474a0d26620260f915d1082a5 @dgrunwald dgrunwald committed Feb 22, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 ICSharpCode.Decompiler/Ast/NameVariables.cs
@@ -99,10 +99,10 @@ static string GetNameFromExpression(ILExpression expr)
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.Ldarg && ((ParameterDefinition)expr.Arguments[0].Operand).Index < 0))
- return ((FieldReference)expr.Operand).Name;
+ return CleanUpVariableName(((FieldReference)expr.Operand).Name);
break;
case ILCode.Ldsfld:
- return ((FieldReference)expr.Operand).Name;
+ return CleanUpVariableName(((FieldReference)expr.Operand).Name);
case ILCode.Call:
case ILCode.Callvirt:
MethodReference mr = (MethodReference)expr.Operand;

0 comments on commit d07a280

Please sign in to comment.