Browse Source

Fix #2079: Allow variables generated from state-machine fields to be propagated in TDCU.

pull/2113/head
Siegfried Pammer 5 years ago
parent
commit
e7d49b2305
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

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

@ -68,7 +68,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
public void Propagate(ILVariable variable) public void Propagate(ILVariable variable)
{ {
Debug.Assert(declaredVariable == null || (variable == null && declaredVariable.StateMachineField == null));
this.declaredVariable = variable; this.declaredVariable = variable;
this.CanPropagate = variable != null; this.CanPropagate = variable != null;
} }
@ -456,7 +455,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{ {
ILVariable v; ILVariable v;
switch (value) { switch (value) {
case LdLoc load when load.Variable.StateMachineField == null: case LdLoc load:
v = load.Variable; v = load.Variable;
if (v.Kind == VariableKind.Parameter) { if (v.Kind == VariableKind.Parameter) {
if (v.LoadCount != 1 && !v.IsThis()) { if (v.LoadCount != 1 && !v.IsThis()) {

Loading…
Cancel
Save