Skip to content

Commit

Permalink
Fix undetermined SPMI behavior. (#34183)
Browse files Browse the repository at this point in the history
* Fix undeterminate SPMI behavior.

* another missed place.
  • Loading branch information
Sergey Andreenko authored Mar 27, 2020
1 parent 3ac7c4d commit d6e3a0f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1458,18 +1458,7 @@ void MethodContext::repGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
(CORINFO_RUNTIME_LOOKUP_KIND)value.stubLookup.lookupKind.runtimeLookupKind;
if (pResult->stubLookup.lookupKind.needsRuntimeLookup)
{
pResult->stubLookup.runtimeLookup.signature =
(LPVOID)value.stubLookup.runtimeLookup.signature; // needs to be a more flexible copy based on
// valuevalue.stubLookup.runtimeLookup.signature;
pResult->stubLookup.runtimeLookup.helper = (CorInfoHelpFunc)value.stubLookup.runtimeLookup.helper;
pResult->stubLookup.runtimeLookup.indirections = (WORD)value.stubLookup.runtimeLookup.indirections;
pResult->stubLookup.runtimeLookup.testForNull = value.stubLookup.runtimeLookup.testForNull != 0;
pResult->stubLookup.runtimeLookup.testForFixup = value.stubLookup.runtimeLookup.testForFixup != 0;
pResult->stubLookup.runtimeLookup.indirectFirstOffset = value.stubLookup.runtimeLookup.indirectFirstOffset != 0;
pResult->stubLookup.runtimeLookup.indirectSecondOffset =
value.stubLookup.runtimeLookup.indirectSecondOffset != 0;
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
pResult->stubLookup.runtimeLookup.offsets[i] = (SIZE_T)value.stubLookup.runtimeLookup.offsets[i];
pResult->stubLookup.runtimeLookup = SpmiRecordsHelper::RestoreCORINFO_RUNTIME_LOOKUP(value.stubLookup.runtimeLookup);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class MethodContext
DWORD indirections;
DWORD testForNull;
DWORD testForFixup;
WORD sizeOffset;
DWORDLONG offsets[CORINFO_MAXINDIRECTIONS];
DWORD indirectFirstOffset;
DWORD indirectSecondOffset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ std::string SpmiDumpHelper::DumpAgnostic_CORINFO_RUNTIME_LOOKUP(
const MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP& lookup)
{
char buffer[MAX_BUFFER_SIZE];
sprintf_s(buffer, MAX_BUFFER_SIZE, " sig-%016llX hlp-%u ind-%u tfn-%u tff-%u { ", lookup.signature, lookup.helper,
lookup.indirections, lookup.testForNull, lookup.testForFixup);
sprintf_s(buffer, MAX_BUFFER_SIZE, " sig-%016llX hlp-%u ind-%u tfn-%u tff-%u so-%u { ", lookup.signature, lookup.helper,
lookup.indirections, lookup.testForNull, lookup.testForFixup, lookup.sizeOffset);
std::string resultDump(buffer);
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ inline MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP SpmiRecordsHelper::StoreAg
runtimeLookup.indirections = (DWORD)pLookup->indirections;
runtimeLookup.testForNull = (DWORD)pLookup->testForNull;
runtimeLookup.testForFixup = (DWORD)pLookup->testForFixup;
runtimeLookup.sizeOffset = pLookup->sizeOffset;
runtimeLookup.indirectFirstOffset = (DWORD)pLookup->indirectFirstOffset;
runtimeLookup.indirectSecondOffset = (DWORD)pLookup->indirectSecondOffset;
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
Expand All @@ -312,6 +313,7 @@ inline CORINFO_RUNTIME_LOOKUP SpmiRecordsHelper::RestoreCORINFO_RUNTIME_LOOKUP(
runtimeLookup.indirections = (WORD)lookup.indirections;
runtimeLookup.testForNull = lookup.testForNull != 0;
runtimeLookup.testForFixup = lookup.testForFixup != 0;
runtimeLookup.sizeOffset = lookup.sizeOffset;
runtimeLookup.indirectFirstOffset = lookup.indirectFirstOffset != 0;
runtimeLookup.indirectSecondOffset = lookup.indirectSecondOffset != 0;
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
Expand Down

0 comments on commit d6e3a0f

Please sign in to comment.