1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed generated method calling in comptime

This commit is contained in:
Brian Fiete 2025-01-18 10:04:55 -08:00
parent 822b899a7d
commit 29755fddcf

View file

@ -8516,6 +8516,18 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
if ((callEntry.mFunctionInfo->mCeFunction == NULL) && (!callEntry.mFunctionInfo->mMethodRef.IsNull()))
{
auto methodRef = callEntry.mFunctionInfo->mMethodRef;
if (methodRef.mMethodNum >= methodRef.mTypeInstance->mTypeDef->mMethods.mSize)
{
// Must be a comptime-generated method
ceModule->PopulateType(methodRef.mTypeInstance);
}
if (methodRef.mMethodNum >= methodRef.mTypeInstance->mTypeDef->mMethods.mSize)
{
_Fail("OOB method reference");
return false;
}
auto methodDef = methodRef.mTypeInstance->mTypeDef->mMethods[methodRef.mMethodNum];
auto moduleMethodInstance = ceModule->GetMethodInstance(methodRef.mTypeInstance, methodDef,
methodRef.mMethodGenericArguments);