Browse Source

Fix #1873: Clear ILRange in CopyPropagation

We are copying an expression from far away, reusing the ILRange would result in incorrect sequence points.
null-coalescing-assignment
Daniel Grunwald 4 months ago
parent
commit
587a359e8c
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs

2
ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs

@ -165,6 +165,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{ {
clone.Children[j].ReplaceWith(new LdLoc(uninlinedArgs[j])); clone.Children[j].ReplaceWith(new LdLoc(uninlinedArgs[j]));
} }
// We are copying an expression from far away, reusing the ILRange would result in incorrect sequence points.
clone.SetILRange(new Interval());
expr.ReplaceWith(clone); expr.ReplaceWith(clone);
} }
block.Instructions.RemoveAt(i); block.Instructions.RemoveAt(i);

Loading…
Cancel
Save