Browse Source

Add CallInstruction.ILStackWasEmpty.

pull/734/merge
Daniel Grunwald 8 years ago
parent
commit
261b1391c0
  1. 1
      ICSharpCode.Decompiler/IL/ILReader.cs
  2. 6
      ICSharpCode.Decompiler/IL/Instructions/CallInstruction.cs

1
ICSharpCode.Decompiler/IL/ILReader.cs

@ -1073,6 +1073,7 @@ namespace ICSharpCode.Decompiler.IL @@ -1073,6 +1073,7 @@ namespace ICSharpCode.Decompiler.IL
goto default;
default:
var call = CallInstruction.Create(opCode, method);
call.ILStackWasEmpty = currentStack.IsEmpty;
call.Arguments.AddRange(arguments);
if (call.ResultType != StackType.Void)
return Push(call);

6
ICSharpCode.Decompiler/IL/Instructions/CallInstruction.cs

@ -52,6 +52,12 @@ namespace ICSharpCode.Decompiler.IL @@ -52,6 +52,12 @@ namespace ICSharpCode.Decompiler.IL
/// </summary>
public IType ConstrainedTo;
/// <summary>
/// Gets whether the IL stack was empty at the point of this call.
/// (not counting the arguments/return value of the call itself)
/// </summary>
public bool ILStackWasEmpty;
protected CallInstruction(OpCode opCode, IMethod method) : base(opCode)
{
Debug.Assert(method != null);

Loading…
Cancel
Save