mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Better failure for invalid method instance
This commit is contained in:
parent
9268e3b25d
commit
5077876ef7
1 changed files with 10 additions and 1 deletions
|
@ -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)
|
bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* startFramePtr, BfType*& returnType)
|
||||||
{
|
{
|
||||||
auto ceModule = mCeMachine->mCeModule;
|
auto ceModule = mCeMachine->mCeModule;
|
||||||
CeFunction* ceFunction = startFunction;
|
CeFunction* ceFunction = startFunction;
|
||||||
returnType = startFunction->mMethodInstance->mReturnType;
|
returnType = startFunction->mMethodInstance->mReturnType;
|
||||||
|
@ -5408,6 +5408,15 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
|
||||||
mCeMachine->PrepareFunction(callEntry.mFunction, NULL);
|
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;
|
callEntry.mBindRevision = mCeMachine->mMethodBindRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue