1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Opaque 'this' argument fix

This commit is contained in:
Brian Fiete 2025-01-30 06:31:56 -08:00
parent 439ae8d3c4
commit 635cb49771

View file

@ -5656,7 +5656,8 @@ BfIRValue BfModule::CreateClassVDataExtGlobal(BfTypeInstance* declTypeInst, BfTy
return mBfIRBuilder->GetFakeVal();
int numElements = declTypeInst->GetSelfVTableSize() - declTypeInst->GetOrigSelfVTableSize();
BF_ASSERT(numElements >= 0);
if (numElements < 0)
InternalError("CreateClassVDataExtGlobal numElements < 0");
if (numElements <= 0)
return BfIRValue();
@ -21968,7 +21969,12 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
if (loweredTypeCode2 != BfTypeCode_None)
argIdx++;
}
else if (!paramVar->mResolvedType->IsValuelessNonOpaqueType())
else if ((isThis) && (paramVar->mResolvedType->IsOpaque()))
{
if ((methodDef->mIsMutating) || (methodInstance->mCallingConvention == BfCallingConvention_Cdecl))
argIdx++;
}
else if (!paramVar->mResolvedType->IsValuelessType())
{
argIdx++;
}