Browse Source

Use proposedNameForStoresFromNewObj only in case of stack slots.

pull/927/head
Siegfried Pammer 8 years ago
parent
commit
7e9f60533b
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/AssignVariableNames.cs

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

@ -196,7 +196,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -196,7 +196,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
proposedName = proposedNameForLoads[0];
}
}
if (string.IsNullOrEmpty(proposedName)) {
if (string.IsNullOrEmpty(proposedName) && variable.Kind == VariableKind.StackSlot) {
var proposedNameForStoresFromNewObj = variable.StoreInstructions.OfType<StLoc>()
.Select(expr => GetNameByType(GuessType(variable.Type, expr.Value, context)))
.Except(currentFieldNames).ToList();

Loading…
Cancel
Save