From 307f782a09779fa34c91445339fcec69d92f1cd6 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 23 Sep 2017 19:57:48 +0200 Subject: [PATCH] Fix bug in DetectLoop: do not accidentally add IncrementBlock to AdditionalBlocks. --- ICSharpCode.Decompiler/IL/DetectedLoop.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ICSharpCode.Decompiler/IL/DetectedLoop.cs b/ICSharpCode.Decompiler/IL/DetectedLoop.cs index 664544519..f5cfc0f76 100644 --- a/ICSharpCode.Decompiler/IL/DetectedLoop.cs +++ b/ICSharpCode.Decompiler/IL/DetectedLoop.cs @@ -110,6 +110,7 @@ namespace ICSharpCode.Decompiler.IL if (IncrementBlock.Instructions[0] is StLoc increment) IncrementTarget = increment.Variable; AdditionalBlocks = Container.Blocks.Skip(1).Where(b => b != IncrementBlock).ToArray(); + return this; } else if (trueInst is Block block) { var variable = GetVariableFromCondition(conditionInst); var last = block.Instructions.LastOrDefault();