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) {