From 3ea2ce4e2d28884310222752f295a382b9fc16f1 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 5 Aug 2019 15:21:03 +0200 Subject: [PATCH] #1349: Fix assertions triggered by incorrect reset implementation in TransformThrowExpressionsValueTypes. ILInstruction.SetChildInstruction should only return early, if index and parent are still the same. --- ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs b/ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs index 609b31dc7..261cf9b63 100644 --- a/ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs +++ b/ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs @@ -628,7 +628,7 @@ namespace ICSharpCode.Decompiler.IL { ILInstruction oldValue = childPointer; Debug.Assert(oldValue == GetChild(index)); - if (oldValue == newValue) + if (oldValue == newValue && newValue?.parent == this && newValue.ChildIndex == index) return; childPointer = newValue; if (newValue != null) {