Browse Source

Fix #2851: assertion after cloning a block with expected result type

pull/2993/head
Daniel Grunwald 2 years ago
parent
commit
6d671071c1
  1. 2
      ICSharpCode.Decompiler/IL/Instructions/BlockContainer.cs

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

@ -88,7 +88,7 @@ namespace ICSharpCode.Decompiler.IL
public override ILInstruction Clone() public override ILInstruction Clone()
{ {
BlockContainer clone = new BlockContainer(); BlockContainer clone = new BlockContainer(this.Kind, this.ExpectedResultType);
clone.AddILRange(this); clone.AddILRange(this);
clone.Blocks.AddRange(this.Blocks.Select(block => (Block)block.Clone())); clone.Blocks.AddRange(this.Blocks.Select(block => (Block)block.Clone()));
// Adjust branch instructions to point to the new container // Adjust branch instructions to point to the new container

Loading…
Cancel
Save