Fix missing lock in CoreRTNameMangler (#33903)
authorTomáš Rylek <trylek@microsoft.com>
Sat, 21 Mar 2020 02:44:47 +0000 (03:44 +0100)
committerGitHub <noreply@github.com>
Sat, 21 Mar 2020 02:44:47 +0000 (19:44 -0700)
src/coreclr/src/tools/Common/Compiler/CoreRTNameMangler.cs

index ec4e90965c962ec2784213e89110dd8d30c5f400..8e0f1247f4c3c7edf6decdaaef602a67feb1ebe6 100644 (file)
@@ -370,8 +370,11 @@ namespace ILCompiler
             else
             {
                 Utf8String utf8MangledName;
-                if (_mangledMethodNames.TryGetValue(method, out utf8MangledName))
-                    return utf8MangledName;
+                lock (this)
+                {
+                    if (_mangledMethodNames.TryGetValue(method, out utf8MangledName))
+                        return utf8MangledName;
+                }
 
                 Utf8StringBuilder sb = new Utf8StringBuilder();
                 sb.Append(GetMangledTypeName(method.OwningType));