Skip to content

Commit c7ba33f

Browse files
authored
Fix build breaks in CoreCLR interpreter (#103240)
1 parent 54cbc9e commit c7ba33f

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/coreclr/vm/interpreter.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ InterpreterMethodInfo::InterpreterMethodInfo(CEEInfo* comp, CORINFO_METHOD_INFO*
148148
// Now look at each local.
149149
CORINFO_ARG_LIST_HANDLE localsPtr = methInfo->locals.args;
150150
CORINFO_CLASS_HANDLE vcTypeRet;
151-
unsigned curLargeStructOffset = 0;
151+
size_t curLargeStructOffset = 0;
152152
for (unsigned k = 0; k < methInfo->locals.numArgs; k++)
153153
{
154154
// TODO: if this optimization succeeds, the switch below on localType
@@ -171,12 +171,12 @@ InterpreterMethodInfo::InterpreterMethodInfo(CEEInfo* comp, CORINFO_METHOD_INFO*
171171
case CORINFO_TYPE_REFANY: // Just a special case: vcTypeRet is handle for TypedReference in this case...
172172
{
173173
InterpreterType tp = InterpreterType(comp, vcTypeRet);
174-
unsigned size = static_cast<unsigned>(tp.Size(comp));
174+
size_t size = tp.Size(comp);
175175
size = max(size, sizeof(void*));
176176
m_localDescs[k].m_type = tp;
177177
if (tp.IsLargeStruct(comp))
178178
{
179-
m_localDescs[k].m_offset = curLargeStructOffset;
179+
m_localDescs[k].m_offset = (unsigned)curLargeStructOffset;
180180
curLargeStructOffset += size;
181181
}
182182
}
@@ -193,7 +193,7 @@ InterpreterMethodInfo::InterpreterMethodInfo(CEEInfo* comp, CORINFO_METHOD_INFO*
193193
m_localDescs[k].m_typeStackNormal = m_localDescs[k].m_type.StackNormalize();
194194
localsPtr = comp->getArgNext(localsPtr);
195195
}
196-
m_largeStructLocalSize = curLargeStructOffset;
196+
m_largeStructLocalSize = (unsigned)curLargeStructOffset;
197197
}
198198

199199
void InterpreterMethodInfo::InitArgInfo(CEEInfo* comp, CORINFO_METHOD_INFO* methInfo, short* argOffsets_)
@@ -724,7 +724,7 @@ void Interpreter::ArgState::AddFPArg(unsigned canonIndex, unsigned short numSlot
724724
CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp,
725725
CORINFO_METHOD_INFO* info,
726726
/*OUT*/ BYTE **nativeEntry,
727-
/*OUT*/ ULONG *nativeSizeOfCode,
727+
/*OUT*/ uint32_t *nativeSizeOfCode,
728728
InterpreterMethodInfo** ppInterpMethodInfo,
729729
bool jmpCall)
730730
{
@@ -1179,7 +1179,7 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp,
11791179
case CORINFO_TYPE_REFANY:
11801180
{
11811181
unsigned sz = getClassSize(vcTypeRet);
1182-
unsigned szSlots = max(1, sz / sizeof(void*));
1182+
unsigned szSlots = max((unsigned)1, (unsigned)(sz / sizeof(void*)));
11831183
#if defined(HOST_X86)
11841184
argState.AddArg(k, static_cast<short>(szSlots), /*noReg*/true);
11851185
#elif defined(HOST_AMD64)
@@ -8138,7 +8138,7 @@ void Interpreter::LdElemWithType()
81388138
_ASSERTE(std::is_integral<T>::value);
81398139

81408140
// Widen narrow types.
8141-
int ires;
8141+
int ires = 0;
81428142
switch (sizeof(T))
81438143
{
81448144
case 1:
@@ -9419,7 +9419,7 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
94199419
if ((sigInfo.callConv & CORINFO_CALLCONV_MASK) == CORINFO_CALLCONV_VARARG)
94209420
{
94219421
Module* module = GetModule(sig.scope);
9422-
vaSigCookie = CORINFO_VARARGS_HANDLE(module->GetVASigCookie(Signature(sig.pSig, sig.cbSig)));
9422+
vaSigCookie = CORINFO_VARARGS_HANDLE(module->GetVASigCookie(Signature(sig.pSig, sig.cbSig), NULL));
94239423
}
94249424
doNotCache = true;
94259425
}
@@ -9818,7 +9818,7 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
98189818
// It will then copy *all* of this into the return buffer area we allocate. So make sure
98199819
// we allocate at least that much.
98209820
#ifdef ENREGISTERED_RETURNTYPE_MAXSIZE
9821-
retBuffSize = max(retTypeSz, ENREGISTERED_RETURNTYPE_MAXSIZE);
9821+
retBuffSize = max(retTypeSz, (size_t)ENREGISTERED_RETURNTYPE_MAXSIZE);
98229822
#endif // ENREGISTERED_RETURNTYPE_MAXSIZE
98239823
pLargeStructRetVal = (BYTE*)_alloca(retBuffSize);
98249824
// Clear this in case a GC happens.
@@ -10391,7 +10391,7 @@ void Interpreter::CallI()
1039110391
// It will then copy *all* of this into the return buffer area we allocate. So make sure
1039210392
// we allocate at least that much.
1039310393
#ifdef ENREGISTERED_RETURNTYPE_MAXSIZE
10394-
retBuffSize = max(retTypeSz, ENREGISTERED_RETURNTYPE_MAXSIZE);
10394+
retBuffSize = max(retTypeSz, (size_t)ENREGISTERED_RETURNTYPE_MAXSIZE);
1039510395
#endif // ENREGISTERED_RETURNTYPE_MAXSIZE
1039610396
pLargeStructRetVal = (BYTE*)_alloca(retBuffSize);
1039710397

@@ -10427,7 +10427,7 @@ void Interpreter::CallI()
1042710427
if ((sigInfo.callConv & CORINFO_CALLCONV_MASK) == CORINFO_CALLCONV_VARARG)
1042810428
{
1042910429
Module* module = GetModule(sigInfo.scope);
10430-
CORINFO_VARARGS_HANDLE handle = CORINFO_VARARGS_HANDLE(module->GetVASigCookie(Signature(sigInfo.pSig, sigInfo.cbSig)));
10430+
CORINFO_VARARGS_HANDLE handle = CORINFO_VARARGS_HANDLE(module->GetVASigCookie(Signature(sigInfo.pSig, sigInfo.cbSig), &sigTypeCtxt));
1043110431
args[curArgSlot] = PtrToArgSlot(handle);
1043210432
argTypes[curArgSlot] = InterpreterType(CORINFO_TYPE_NATIVEINT);
1043310433
curArgSlot++;
@@ -11579,7 +11579,7 @@ void InterpreterCache<Key,Val>::EnsureCanInsert()
1157911579
}
1158011580
else
1158111581
{
11582-
unsigned short newSize = min(m_allocSize * 2, USHRT_MAX);
11582+
unsigned short newSize = (unsigned short)min(m_allocSize * 2, USHRT_MAX);
1158311583

1158411584
KeyValPair* newPairs = new KeyValPair[newSize];
1158511585
memcpy(newPairs, m_pairs, m_count * sizeof(KeyValPair));

src/coreclr/vm/interpreter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ class Interpreter
764764
static CorJitResult GenerateInterpreterStub(CEEInfo* comp,
765765
CORINFO_METHOD_INFO* info,
766766
/*OUT*/ BYTE **nativeEntry,
767-
/*OUT*/ ULONG *nativeSizeOfCode,
767+
/*OUT*/ uint32_t *nativeSizeOfCode,
768768
InterpreterMethodInfo** ppInterpMethodInfo = NULL,
769769
bool jmpCall = false);
770770

src/coreclr/vm/jitinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12422,7 +12422,7 @@ static CorJitResult CompileMethodWithEtwWrapper(EEJitManager *jitMgr,
1242212422
struct CORINFO_METHOD_INFO *info,
1242312423
unsigned flags,
1242412424
BYTE **nativeEntry,
12425-
ULONG *nativeSizeOfCode)
12425+
uint32_t *nativeSizeOfCode)
1242612426
{
1242712427
STATIC_CONTRACT_THROWS;
1242812428
STATIC_CONTRACT_GC_TRIGGERS;

0 commit comments

Comments
 (0)