Browse Source

CachedDelegateInitialization: Do not lose IL range by creating a new store instruction, reuse existing instruction instead.

pull/1409/head
Siegfried Pammer 7 years ago
parent
commit
99fc57c6be
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/CachedDelegateInitialization.cs

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

@ -116,7 +116,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false; return false;
context.Step("CachedDelegateInitializationWithLocal", inst); context.Step("CachedDelegateInitializationWithLocal", inst);
((Block)otherStore.Parent).Instructions.Remove(otherStore); ((Block)otherStore.Parent).Instructions.Remove(otherStore);
inst.ReplaceWith(new StLoc(v, value)); inst.ReplaceWith(storeInst);
return true; return true;
} }

Loading…
Cancel
Save