Fix issues with JitStressRange (#39754)
authorEgor Chesakov <Egor.Chesakov@microsoft.com>
Fri, 24 Jul 2020 22:48:32 +0000 (15:48 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2020 22:48:32 +0000 (15:48 -0700)
* Add 10 when digit is [a-fA-F] in ConfigMethodRange::InitRanges in utils.cpp

* Zero out compMethodHashPrivate earlier in Compiler::compInit() in compiler.cpp

src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/utils.cpp

index c78ee44..cb129b3 100644 (file)
@@ -1764,6 +1764,10 @@ void Compiler::compInit(ArenaAllocator*       pAlloc,
     info.compPerfScore = 0.0;
 #endif // defined(DEBUG) || defined(LATE_DISASM)
 
+#if defined(DEBUG) || defined(INLINE_DATA)
+    info.compMethodHashPrivate = 0;
+#endif // defined(DEBUG) || defined(INLINE_DATA)
+
 #ifdef DEBUG
     // Opt-in to jit stress based on method hash ranges.
     //
@@ -5287,10 +5291,6 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr,
     verbose = compIsForInlining() ? impInlineInfo->InlinerCompiler->verbose : false;
 #endif
 
-#if defined(DEBUG) || defined(INLINE_DATA)
-    info.compMethodHashPrivate = 0;
-#endif // defined(DEBUG) || defined(INLINE_DATA)
-
 #if FUNC_INFO_LOGGING
     LPCWSTR tmpJitFuncInfoFilename = JitConfig.JitFuncInfoFile();
 
index 4477ceb..36e901a 100644 (file)
@@ -767,11 +767,11 @@ void ConfigMethodRange::InitRanges(const WCHAR* rangeStr, unsigned capacity)
             }
             else if ((L'A' <= *p) && (*p <= L'F'))
             {
-                n = (*p++) - L'A';
+                n = (*p++) - L'A' + 10;
             }
             else if ((L'a' <= *p) && (*p <= L'f'))
             {
-                n = (*p++) - L'a';
+                n = (*p++) - L'a' + 10;
             }
 
             int j = 16 * i + n;