From 1709c7fc15dda4caa7a95e9ccf7e37a282ba6c35 Mon Sep 17 00:00:00 2001 From: Oleg Stepanischev Date: Sun, 27 Jun 2021 13:30:43 +0300 Subject: [PATCH] 0.5.1: Revert inline - fixed deferred --- src/InlineMethod.Fody/InlineMethodWeaver.cs | 7 ++++++- src/InlineMethod/InlineMethod.csproj | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/InlineMethod.Fody/InlineMethodWeaver.cs b/src/InlineMethod.Fody/InlineMethodWeaver.cs index b99f77c..4e3ac78 100644 --- a/src/InlineMethod.Fody/InlineMethodWeaver.cs +++ b/src/InlineMethod.Fody/InlineMethodWeaver.cs @@ -314,7 +314,12 @@ private void ProcessDeferred() { if (_deferredInstruction != null) { - OpCodeHelper.ReplaceInstruction(_deferredInstruction, GetLdArgInstruction()); + var ldArgInstruction = GetLdArgInstruction(); + OpCodeHelper.ReplaceInstruction(_deferredInstruction, ldArgInstruction); + if (_inlinedInstructions.Count > 0 && _inlinedInstructions[_inlinedInstructions.Count - 1] == ldArgInstruction) + { + _inlinedInstructions[_inlinedInstructions.Count - 1] = _deferredInstruction; + } _deferredInstruction = null; } } diff --git a/src/InlineMethod/InlineMethod.csproj b/src/InlineMethod/InlineMethod.csproj index 06b713b..96e5e13 100644 --- a/src/InlineMethod/InlineMethod.csproj +++ b/src/InlineMethod/InlineMethod.csproj @@ -12,7 +12,7 @@ $(SolutionDir)/../nugets https://github.com/oleg-st/InlineMethod.Fody false - 0.5 + 0.5.1