1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 15:26:00 +02:00

Better failure for invalid method instance

This commit is contained in:
Brian Fiete 2021-02-07 16:17:47 -08:00
parent 9268e3b25d
commit 5077876ef7

View file

@ -4335,7 +4335,7 @@ static void CeSetAddrVal(void* ptr, addr_ce val, int32 ptrSize)
}
bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* startFramePtr, BfType*& returnType)
{
{
auto ceModule = mCeMachine->mCeModule;
CeFunction* ceFunction = startFunction;
returnType = startFunction->mMethodInstance->mReturnType;
@ -5408,6 +5408,15 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
mCeMachine->PrepareFunction(callEntry.mFunction, NULL);
}
if (callEntry.mFunction->mMethodInstance != NULL)
{
if (callEntry.mFunction->mMethodInstance->GetOwner()->IsDeleting())
{
_Fail("Calling method on deleted type");
return false;
}
}
callEntry.mBindRevision = mCeMachine->mMethodBindRevision;
}