Browse Source

fix copy-paste error in PeekOrDefault extension

pull/728/head
Siegfried Pammer 10 years ago
parent
commit
7fdb7765c8
  1. 2
      ICSharpCode.Decompiler/IL/ILReader.cs
  2. 1
      ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs
  3. 2
      ICSharpCode.Decompiler/Util/CollectionExtensions.cs

2
ICSharpCode.Decompiler/IL/ILReader.cs

@ -151,7 +151,7 @@ namespace ICSharpCode.Decompiler.IL
/// </summary> /// </summary>
void Warn(string message) void Warn(string message)
{ {
//Debug.Fail(message); Debug.Fail(message);
} }
void ReadInstructions(Dictionary<int, ImmutableArray<StackType>> outputStacks, CancellationToken cancellationToken) void ReadInstructions(Dictionary<int, ImmutableArray<StackType>> outputStacks, CancellationToken cancellationToken)

1
ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs

@ -59,6 +59,7 @@ namespace ICSharpCode.Decompiler.IL
this.Sign = sign; this.Sign = sign;
this.CompoundAssignmentType = compoundAssignmentType; this.CompoundAssignmentType = compoundAssignmentType;
this.resultType = ComputeResultType(opCode, left.ResultType, right.ResultType); this.resultType = ComputeResultType(opCode, left.ResultType, right.ResultType);
Debug.Assert(resultType != StackType.Unknown);
Debug.Assert(CompoundAssignmentType == CompoundAssignmentType.None || IsValidCompoundAssignmentTarget(Left)); Debug.Assert(CompoundAssignmentType == CompoundAssignmentType.None || IsValidCompoundAssignmentTarget(Left));
} }

2
ICSharpCode.Decompiler/Util/CollectionExtensions.cs

@ -19,7 +19,7 @@ namespace ICSharpCode.Decompiler
{ {
if (stack.Count == 0) if (stack.Count == 0)
return default(T); return default(T);
return stack.Pop(); return stack.Peek();
} }
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> input) public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> input)

Loading…
Cancel
Save