Browse Source

Fix #1956: Adapt previous fix for variable names that have a number as suffix.

pull/3416/head
Siegfried Pammer 3 months ago
parent
commit
8a67f48e4e
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/AssignVariableNames.cs

3
ICSharpCode.Decompiler/IL/Transforms/AssignVariableNames.cs

@ -215,7 +215,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -215,7 +215,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (variables.TryGetValue(i, out var v))
variableMapping[v] = p.Name;
}
if (!parentScope.IsReservedVariableName(p.Name, out _))
string nameWithoutNumber = SplitName(p.Name, out int newIndex);
if (!parentScope.IsReservedVariableName(nameWithoutNumber, out _))
{
AddExistingName(reservedVariableNames, p.Name);
if (variables.TryGetValue(i, out var v))

Loading…
Cancel
Save