Fix overlooked moduleIndex initial value (#24881)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 31 May 2019 16:46:12 +0000 (18:46 +0200)
committerJan Kotas <jkotas@microsoft.com>
Fri, 31 May 2019 16:46:12 +0000 (09:46 -0700)
When adding the signature copying some time ago, I have overlooked one
place where the moduleIndex was set to -1 instead of MODULE_INDEX_NONE.
I was using the -1 during the development and replaced it by creating
MODULE_INDEX_NONE during final cleanup at all but one places.

This caused issues during crossgen even without large version bubble
enabled. Methods requiring generic constraint were not crossgen-ed due
to this.

src/vm/zapsig.cpp

index 4914246..08d9228 100644 (file)
@@ -1530,7 +1530,7 @@ BOOL ZapSig::EncodeMethod(
         {
             _ASSERTE(pConstrainedResolvedToken->cbTypeSpec > 0);
 
-            DWORD moduleIndex = (DWORD)-1;
+            DWORD moduleIndex = MODULE_INDEX_NONE;
             if (IsReadyToRunCompilation() && pMethod->GetModule()->IsInCurrentVersionBubble() && pInfoModule != (Module *) pConstrainedResolvedToken->tokenScope)
             {
                 moduleIndex = (*((EncodeModuleCallback)pfnEncodeModule))(pEncodeModuleContext, (Module *) pConstrainedResolvedToken->tokenScope);