From 587a359e8c37b1745afdca9442c0eaa23834a9de Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 23 Aug 2025 20:05:45 +0200 Subject: [PATCH] Fix #1873: Clear ILRange in CopyPropagation We are copying an expression from far away, reusing the ILRange would result in incorrect sequence points. --- ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs b/ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs index 10435130b..7b45ba662 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs @@ -165,6 +165,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms { 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); } block.Instructions.RemoveAt(i);