Browse Source

Fixed bug that might have caused some code to be duplicated

pull/37/head
David Srbecký 15 years ago
parent
commit
022111fa9f
  1. 7
      ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs
  2. 2
      ICSharpCode.Decompiler/ILAst/ILAstTypes.cs

7
ICSharpCode.Decompiler/ILAst/ILAstOptimizer.cs

@ -194,6 +194,9 @@ namespace Decompiler.ControlFlow @@ -194,6 +194,9 @@ namespace Decompiler.ControlFlow
{
List<ILNode> result = new List<ILNode>();
// Do not modify entry data
scope = new HashSet<ControlFlowNode>(scope);
Queue<ControlFlowNode> agenda = new Queue<ControlFlowNode>();
agenda.Enqueue(entryPoint);
while(agenda.Count > 0) {
@ -241,6 +244,7 @@ namespace Decompiler.ControlFlow @@ -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 @@ -259,6 +263,9 @@ namespace Decompiler.ControlFlow
{
List<ILNode> result = new List<ILNode>();
// Do not modify entry data
scope = new HashSet<ControlFlowNode>(scope);
HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>();
agenda.Add(entryNode);
while(agenda.Any()) {

2
ICSharpCode.Decompiler/ILAst/ILAstTypes.cs

@ -30,7 +30,7 @@ namespace Decompiler @@ -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);

Loading…
Cancel
Save