Browse Source

TDCU: make sure that copies of display-class variables are validated as well.

pull/2566/head
Siegfried Pammer 4 years ago
parent
commit
f801059659
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

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

@ -204,7 +204,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -204,7 +204,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
bool ValidateDisplayClassUses(ILVariable v, DisplayClass displayClass)
{
Debug.Assert(v == displayClass.Variable);
foreach (var ldloc in v.LoadInstructions)
{
if (!ValidateUse(displayClass, ldloc))
@ -239,7 +238,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -239,7 +238,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
case StLoc stloc when stloc.Variable.IsSingleDefinition && stloc.Value == use:
displayClassCopyMap[stloc.Variable] = v;
return true;
return ValidateDisplayClassUses(stloc.Variable, displayClass);
default:
return false;
}

Loading…
Cancel
Save