From 04056d4d59056d8697c7466810a05932b1976237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 14 May 2024 16:46:51 +0900 Subject: [PATCH] Fix name mangling for CoreLib (#102183) #96983 broke name mangling within corelib - we were not prepending the assembly name and not replacing dots with underscores. --- src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs b/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs index 844cf58f20bd73..fb6555e4d29005 100644 --- a/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs +++ b/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs @@ -202,6 +202,8 @@ private string ComputeMangledTypeName(TypeDesc type) containingType = containingType.ContainingType; } + name = prependAssemblyName + "_" + SanitizeName(name, true); + // If this is one of the well known types, use a shorter name // We know this won't conflict because all the other types are // prefixed by the assembly name. @@ -231,10 +233,6 @@ private string ComputeMangledTypeName(TypeDesc type) break; } } - else - { - name = prependAssemblyName + "_" + SanitizeName(name, true); - } // Ensure that name is unique and update our tables accordingly. name = DisambiguateName(name, deduplicator);