Browse Source

Enable MCS yield return pretty tests.

pull/1561/head
Siegfried Pammer 6 years ago
parent
commit
c1ac461c26
  1. 2
      ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
  2. 4
      ICSharpCode.Decompiler/IL/Transforms/RemoveDeadVariableInit.cs

2
ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs

@ -420,7 +420,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -420,7 +420,7 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
public void YieldReturn([ValueSource(nameof(defaultOptions))] CompilerOptions cscOptions)
public void YieldReturn([ValueSource(nameof(defaultOptionsWithMcs))] CompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}

4
ICSharpCode.Decompiler/IL/Transforms/RemoveDeadVariableInit.cs

@ -53,6 +53,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -53,6 +53,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
var v = variableQueue.Dequeue();
if (v.Kind != VariableKind.Local && v.Kind != VariableKind.StackSlot)
continue;
// Skip variables that are captured in a mcs yield state-machine
// loads of these will only be visible after DelegateConstruction step.
if (function.StateMachineCompiledWithMono && v.StateMachineField != null)
continue;
if (v.LoadCount != 0 || v.AddressCount != 0)
continue;
foreach (var stloc in v.StoreInstructions.OfType<StLoc>().ToArray()) {

Loading…
Cancel
Save