Browse Source

#1349: Fix assertions triggered by incorrect reset implementation in TransformThrowExpressionsValueTypes. ILInstruction.SetChildInstruction should only return early, if index and parent are still the same.

pull/1633/head
Siegfried Pammer 6 years ago
parent
commit
3ea2ce4e2d
  1. 2
      ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs

2
ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs

@ -628,7 +628,7 @@ namespace ICSharpCode.Decompiler.IL @@ -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) {

Loading…
Cancel
Save