From 747d4c81783b526ee54b9e2fc5c1a45d27d65966 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 4 Dec 2022 13:36:26 +0100 Subject: [PATCH] Improve assertion to apply to the C# type instead of the ILAst type --- ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs index 55aabafca..fcdbdfa0e 100644 --- a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs @@ -1902,7 +1902,7 @@ namespace ICSharpCode.Decompiler.CSharp { Debug.Assert(op == AssignmentOperatorType.Add || op == AssignmentOperatorType.Subtract); #if DEBUG - if (inst.Type is PointerType ptrType) + if (target.Type is PointerType ptrType) { ILInstruction instValue = PointerArithmeticOffset.Detect(inst.Value, ptrType.ElementType, inst.CheckForOverflow); Debug.Assert(instValue is not null);