Fix incorrect usage of u16_strcmp instead of u16_strncmp (#86356)
authorDavid Wrighton <davidwr@microsoft.com>
Wed, 17 May 2023 01:02:01 +0000 (18:02 -0700)
committerGitHub <noreply@github.com>
Wed, 17 May 2023 01:02:01 +0000 (18:02 -0700)
src/coreclr/md/compiler/emit.cpp

index 62fa88fcda3764164138026aefd675e10b69101f..f2df925feaa8b019e709096d50500de6cde8a920 100644 (file)
@@ -114,7 +114,7 @@ STDMETHODIMP RegMeta::DefineMethod(           // S_OK or error.
 
     if (!u16_strcmp(szName, W(".ctor")) || // COR_CTOR_METHOD_NAME_W
         !u16_strcmp(szName, W(".cctor")) || // COR_CCTOR_METHOD_NAME_W
-        !u16_strcmp(szName, W("_VtblGap")) )
+        !u16_strncmp(szName, W("_VtblGap"), 8) ) // All methods that begin with the characters "_VtblGap" are considered to be VTable Gap methods
     {
         dwMethodFlags |= mdRTSpecialName | mdSpecialName;
     }