From 7fdb7765c80ca609e61ce9ab183641ca5a2d06b0 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 30 May 2015 17:43:50 +0200 Subject: [PATCH] fix copy-paste error in PeekOrDefault extension --- ICSharpCode.Decompiler/IL/ILReader.cs | 2 +- .../IL/Instructions/BinaryNumericInstruction.cs | 1 + ICSharpCode.Decompiler/Util/CollectionExtensions.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/IL/ILReader.cs b/ICSharpCode.Decompiler/IL/ILReader.cs index 19ba9683c..92763b11b 100644 --- a/ICSharpCode.Decompiler/IL/ILReader.cs +++ b/ICSharpCode.Decompiler/IL/ILReader.cs @@ -151,7 +151,7 @@ namespace ICSharpCode.Decompiler.IL /// void Warn(string message) { - //Debug.Fail(message); + Debug.Fail(message); } void ReadInstructions(Dictionary> outputStacks, CancellationToken cancellationToken) diff --git a/ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs b/ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs index 457037c1e..0eca8dcf2 100644 --- a/ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs +++ b/ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs @@ -59,6 +59,7 @@ namespace ICSharpCode.Decompiler.IL this.Sign = sign; this.CompoundAssignmentType = compoundAssignmentType; this.resultType = ComputeResultType(opCode, left.ResultType, right.ResultType); + Debug.Assert(resultType != StackType.Unknown); Debug.Assert(CompoundAssignmentType == CompoundAssignmentType.None || IsValidCompoundAssignmentTarget(Left)); } diff --git a/ICSharpCode.Decompiler/Util/CollectionExtensions.cs b/ICSharpCode.Decompiler/Util/CollectionExtensions.cs index accb32b73..cd4c7356b 100644 --- a/ICSharpCode.Decompiler/Util/CollectionExtensions.cs +++ b/ICSharpCode.Decompiler/Util/CollectionExtensions.cs @@ -19,7 +19,7 @@ namespace ICSharpCode.Decompiler { if (stack.Count == 0) return default(T); - return stack.Pop(); + return stack.Peek(); } public static void AddRange(this ICollection collection, IEnumerable input)