From ea8b0fb2991eb505424b8092856155e9fef0364e Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 17 Oct 2023 21:43:34 +0200 Subject: [PATCH] Fix #3104: Escape global type and entry point in CSharpLanguage.DecompileAssembly --- ILSpy/Languages/CSharpLanguage.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ILSpy/Languages/CSharpLanguage.cs b/ILSpy/Languages/CSharpLanguage.cs index 144a7a456..c93223dbc 100644 --- a/ILSpy/Languages/CSharpLanguage.cs +++ b/ILSpy/Languages/CSharpLanguage.cs @@ -28,9 +28,7 @@ using System.Text; using System.Windows; using System.Windows.Controls; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.AvalonEdit.Utils; using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.CSharp; using ICSharpCode.Decompiler.CSharp.OutputVisitor; @@ -42,7 +40,6 @@ using ICSharpCode.Decompiler.Output; using ICSharpCode.Decompiler.Solution; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.Util; -using ICSharpCode.ILSpy.Options; using ICSharpCode.ILSpy.TextView; using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpyX; @@ -426,7 +423,7 @@ namespace ICSharpCode.ILSpy if (globalType != null) { output.Write("// Global type: "); - output.WriteReference(globalType, globalType.FullName); + output.WriteReference(globalType, EscapeName(globalType.FullName)); output.WriteLine(); } var metadata = module.Metadata; @@ -438,7 +435,7 @@ namespace ICSharpCode.ILSpy if (entrypoint != null) { output.Write("// Entry point: "); - output.WriteReference(entrypoint, entrypoint.DeclaringType.FullName + "." + entrypoint.Name); + output.WriteReference(entrypoint, EscapeName(entrypoint.DeclaringType.FullName + "." + entrypoint.Name)); output.WriteLine(); } }