Skip to content

Commit d6e3a0f

Browse files
author
Sergey Andreenko
authored
Fix undetermined SPMI behavior. (#34183)
* Fix undeterminate SPMI behavior. * another missed place.
1 parent 3ac7c4d commit d6e3a0f

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,18 +1458,7 @@ void MethodContext::repGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
14581458
(CORINFO_RUNTIME_LOOKUP_KIND)value.stubLookup.lookupKind.runtimeLookupKind;
14591459
if (pResult->stubLookup.lookupKind.needsRuntimeLookup)
14601460
{
1461-
pResult->stubLookup.runtimeLookup.signature =
1462-
(LPVOID)value.stubLookup.runtimeLookup.signature; // needs to be a more flexible copy based on
1463-
// valuevalue.stubLookup.runtimeLookup.signature;
1464-
pResult->stubLookup.runtimeLookup.helper = (CorInfoHelpFunc)value.stubLookup.runtimeLookup.helper;
1465-
pResult->stubLookup.runtimeLookup.indirections = (WORD)value.stubLookup.runtimeLookup.indirections;
1466-
pResult->stubLookup.runtimeLookup.testForNull = value.stubLookup.runtimeLookup.testForNull != 0;
1467-
pResult->stubLookup.runtimeLookup.testForFixup = value.stubLookup.runtimeLookup.testForFixup != 0;
1468-
pResult->stubLookup.runtimeLookup.indirectFirstOffset = value.stubLookup.runtimeLookup.indirectFirstOffset != 0;
1469-
pResult->stubLookup.runtimeLookup.indirectSecondOffset =
1470-
value.stubLookup.runtimeLookup.indirectSecondOffset != 0;
1471-
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
1472-
pResult->stubLookup.runtimeLookup.offsets[i] = (SIZE_T)value.stubLookup.runtimeLookup.offsets[i];
1461+
pResult->stubLookup.runtimeLookup = SpmiRecordsHelper::RestoreCORINFO_RUNTIME_LOOKUP(value.stubLookup.runtimeLookup);
14731462
}
14741463
else
14751464
{

src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ class MethodContext
231231
DWORD indirections;
232232
DWORD testForNull;
233233
DWORD testForFixup;
234+
WORD sizeOffset;
234235
DWORDLONG offsets[CORINFO_MAXINDIRECTIONS];
235236
DWORD indirectFirstOffset;
236237
DWORD indirectSecondOffset;

src/coreclr/src/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ std::string SpmiDumpHelper::DumpAgnostic_CORINFO_RUNTIME_LOOKUP(
5858
const MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP& lookup)
5959
{
6060
char buffer[MAX_BUFFER_SIZE];
61-
sprintf_s(buffer, MAX_BUFFER_SIZE, " sig-%016llX hlp-%u ind-%u tfn-%u tff-%u { ", lookup.signature, lookup.helper,
62-
lookup.indirections, lookup.testForNull, lookup.testForFixup);
61+
sprintf_s(buffer, MAX_BUFFER_SIZE, " sig-%016llX hlp-%u ind-%u tfn-%u tff-%u so-%u { ", lookup.signature, lookup.helper,
62+
lookup.indirections, lookup.testForNull, lookup.testForFixup, lookup.sizeOffset);
6363
std::string resultDump(buffer);
6464
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
6565
{

src/coreclr/src/ToolBox/superpmi/superpmi-shared/spmirecordhelper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ inline MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP SpmiRecordsHelper::StoreAg
296296
runtimeLookup.indirections = (DWORD)pLookup->indirections;
297297
runtimeLookup.testForNull = (DWORD)pLookup->testForNull;
298298
runtimeLookup.testForFixup = (DWORD)pLookup->testForFixup;
299+
runtimeLookup.sizeOffset = pLookup->sizeOffset;
299300
runtimeLookup.indirectFirstOffset = (DWORD)pLookup->indirectFirstOffset;
300301
runtimeLookup.indirectSecondOffset = (DWORD)pLookup->indirectSecondOffset;
301302
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
@@ -312,6 +313,7 @@ inline CORINFO_RUNTIME_LOOKUP SpmiRecordsHelper::RestoreCORINFO_RUNTIME_LOOKUP(
312313
runtimeLookup.indirections = (WORD)lookup.indirections;
313314
runtimeLookup.testForNull = lookup.testForNull != 0;
314315
runtimeLookup.testForFixup = lookup.testForFixup != 0;
316+
runtimeLookup.sizeOffset = lookup.sizeOffset;
315317
runtimeLookup.indirectFirstOffset = lookup.indirectFirstOffset != 0;
316318
runtimeLookup.indirectSecondOffset = lookup.indirectSecondOffset != 0;
317319
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)

0 commit comments

Comments
 (0)