|
|
|
@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Text; |
|
|
|
|
|
|
|
|
|
using ICSharpCode.Decompiler.IL.Transforms; |
|
|
|
@ -29,7 +30,10 @@ namespace ICSharpCode.Decompiler.IL
@@ -29,7 +30,10 @@ namespace ICSharpCode.Decompiler.IL
|
|
|
|
|
{ |
|
|
|
|
public void Run(ILFunction function, ILTransformContext context) |
|
|
|
|
{ |
|
|
|
|
foreach (var variable in function.Variables) |
|
|
|
|
foreach (var nestedFunction in function.Descendants.OfType<ILFunction>()) |
|
|
|
|
{ |
|
|
|
|
HashSet<int> dynamicVariables = new(); |
|
|
|
|
foreach (var variable in nestedFunction.Variables) |
|
|
|
|
{ |
|
|
|
|
if (variable.Kind != VariableKind.Local && |
|
|
|
|
variable.Kind != VariableKind.StackSlot && |
|
|
|
@ -48,8 +52,23 @@ namespace ICSharpCode.Decompiler.IL
@@ -48,8 +52,23 @@ namespace ICSharpCode.Decompiler.IL
|
|
|
|
|
if (!argumentInfo.HasFlag(CSharpArgumentInfoFlags.UseCompileTimeType)) |
|
|
|
|
{ |
|
|
|
|
variable.Type = SpecialType.Dynamic; |
|
|
|
|
if (variable.Index.HasValue && variable.Kind == VariableKind.Local) |
|
|
|
|
{ |
|
|
|
|
dynamicVariables.Add(variable.Index.Value); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach (var variable in nestedFunction.Variables) |
|
|
|
|
{ |
|
|
|
|
if (variable.Index.HasValue && variable.Kind == VariableKind.Local |
|
|
|
|
&& dynamicVariables.Contains(variable.Index.Value)) |
|
|
|
|
{ |
|
|
|
|
variable.Type = SpecialType.Dynamic; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|