1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Deleted type protection in EmitGCMarkValue, RequestExtraCompile feature

This commit is contained in:
Brian Fiete 2025-02-19 12:01:06 -08:00
parent 6e0cabf8aa
commit 471897a150
6 changed files with 81 additions and 1 deletions

View file

@ -4730,6 +4730,7 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
if (fieldType->IsDeleting())
{
mCompiler->RequestExtraCompile();
InternalError("Field using deleted type", fieldDef->GetRefNode());
}
else if (fieldType->IsVar())
@ -11264,6 +11265,7 @@ BfMethodInstance* BfModule::GetRawMethodInstanceAtIdx(BfTypeInstance* typeInstan
{
if (typeInstance->IsDeleting())
{
mCompiler->RequestExtraCompile();
InternalError("GetRawMethodInstanceAtIdx for deleted type", typeInstance->mTypeDef->GetRefNode());
return NULL;
}
@ -20301,6 +20303,13 @@ void BfModule::EmitGCMarkValue(BfTypedValue& thisValue, BfType* checkType, int m
if (!checkType->WantsGCMarking())
return;
if (checkType->IsDeleting())
{
mCompiler->RequestExtraCompile();
InternalError("EmitGCMarkValue deleted type");
return;
}
auto typeInstance = checkType->ToTypeInstance();
bool callMarkMethod = false;