diff --git a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs index 1cd72dc03..f77afe924 100644 --- a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs @@ -167,16 +167,19 @@ namespace ICSharpCode.Decompiler.CSharp } else if (inst is ILiftableInstruction liftable && liftable.IsLifted) { - Debug.Assert(NullableType.IsNullable(cexpr.Type)); - IType underlying = NullableType.GetUnderlyingType(cexpr.Type); - if (liftable.UnderlyingResultType.IsIntegerType()) + if (liftable.UnderlyingResultType != StackType.Unknown) { - Debug.Assert(underlying.GetStackType().IsIntegerType(), "IL instructions of integer type must convert into C# expressions of integer type"); - Debug.Assert(underlying.GetSign() != Sign.None, "Must have a sign specified for zero/sign-extension"); - } - else - { - Debug.Assert(underlying.GetStackType() == liftable.UnderlyingResultType); + Debug.Assert(NullableType.IsNullable(cexpr.Type)); + IType underlying = NullableType.GetUnderlyingType(cexpr.Type); + if (liftable.UnderlyingResultType.IsIntegerType()) + { + Debug.Assert(underlying.GetStackType().IsIntegerType(), "IL instructions of integer type must convert into C# expressions of integer type"); + Debug.Assert(underlying.GetSign() != Sign.None, "Must have a sign specified for zero/sign-extension"); + } + else + { + Debug.Assert(underlying.GetStackType() == liftable.UnderlyingResultType); + } } } else if (inst.ResultType == StackType.Ref)