From 022111fa9fccacabd768fff83a83712104c28be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Tue, 22 Feb 2011 23:25:37 +0000 Subject: [PATCH] Fixed bug that might have caused some code to be duplicated --- ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs | 7 +++++++ ICSharpCode.Decompiler/ILAst/ILAstTypes.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs b/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs index ece707daf..1d0e2785a 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs @@ -194,6 +194,9 @@ namespace Decompiler.ControlFlow { List result = new List(); + // Do not modify entry data + scope = new HashSet(scope); + Queue agenda = new Queue(); agenda.Enqueue(entryPoint); while(agenda.Count > 0) { @@ -241,6 +244,7 @@ namespace Decompiler.ControlFlow foreach(var node in scope) { result.Add((ILNode)node.UserData); } + scope.Clear(); return result; } @@ -259,6 +263,9 @@ namespace Decompiler.ControlFlow { List result = new List(); + // Do not modify entry data + scope = new HashSet(scope); + HashSet agenda = new HashSet(); agenda.Add(entryNode); while(agenda.Any()) { diff --git a/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs b/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs index 82c05d985..8280ccf76 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstTypes.cs @@ -30,7 +30,7 @@ namespace Decompiler { StringWriter w = new StringWriter(); WriteTo(new PlainTextOutput(w)); - return w.ToString(); + return w.ToString().Replace("\r\n", "; "); } public abstract void WriteTo(ITextOutput output);