Browse Source

add TransformStackIntoVariables for IfInstruction

pull/728/head
Siegfried Pammer 11 years ago
parent
commit
36e39f2c02
  1. 9
      ICSharpCode.Decompiler/IL/Instructions/IfInstruction.cs

9
ICSharpCode.Decompiler/IL/Instructions/IfInstruction.cs

@ -61,7 +61,14 @@ namespace ICSharpCode.Decompiler.IL @@ -61,7 +61,14 @@ namespace ICSharpCode.Decompiler.IL
internal override void TransformStackIntoVariables(TransformStackIntoVariablesState state)
{
throw new NotImplementedException();
Condition.TransformStackIntoVariables(state);
var stackAfterCondition = state.Variables.Clone();
TrueInst.Inline(InstructionFlags.None, state).TransformStackIntoVariables(state);
var afterTrue = state.Variables.Clone();
state.Variables = stackAfterCondition;
FalseInst.Inline(InstructionFlags.None, state).TransformStackIntoVariables(state);
if (!TrueInst.HasFlag(InstructionFlags.EndPointUnreachable) && !FalseInst.HasFlag(InstructionFlags.EndPointUnreachable))
state.MergeVariables(state.Variables, afterTrue);
}
protected override InstructionFlags ComputeFlags()

Loading…
Cancel
Save