Skip to content

Commit

Permalink
Fix issues with JitStressRange (dotnet#39754)
Browse files Browse the repository at this point in the history
* Add 10 when digit is [a-fA-F] in ConfigMethodRange::InitRanges in utils.cpp

* Zero out compMethodHashPrivate earlier in Compiler::compInit() in compiler.cpp
  • Loading branch information
echesakov authored Jul 24, 2020
1 parent e856fbf commit 8782d4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/coreclr/src/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/jit/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8782d4b

Please sign in to comment.