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

Fixed mMaxGenericDepth test of non-generic inner type inside generic

This commit is contained in:
Brian Fiete 2025-05-27 14:58:51 +02:00
parent c0d5995c3c
commit eb4d2a1757

View file

@ -12107,6 +12107,7 @@ BfType* BfModule::ResolveTypeRef_Ref(BfTypeReference* typeRef, BfPopulateType po
genericTypeInst->mGenericTypeInfo->mGenericParams.push_back(parentGenericTypeInstance->mGenericTypeInfo->mGenericParams[i]->AddRef()); genericTypeInst->mGenericTypeInfo->mGenericParams.push_back(parentGenericTypeInstance->mGenericTypeInfo->mGenericParams[i]->AddRef());
genericTypeInst->mGenericTypeInfo->mTypeGenericArguments.push_back(parentGenericTypeInstance->mGenericTypeInfo->mTypeGenericArguments[i]); genericTypeInst->mGenericTypeInfo->mTypeGenericArguments.push_back(parentGenericTypeInstance->mGenericTypeInfo->mTypeGenericArguments[i]);
} }
genericTypeInst->mGenericTypeInfo->mMaxGenericDepth = BF_MAX(genericTypeInst->mGenericTypeInfo->mMaxGenericDepth, parentGenericTypeInstance->GetGenericDepth() + 1);
CheckUnspecializedGenericType(genericTypeInst, populateType); CheckUnspecializedGenericType(genericTypeInst, populateType);
resolvedEntry->mValue = genericTypeInst; resolvedEntry->mValue = genericTypeInst;
@ -12428,7 +12429,7 @@ BfType* BfModule::ResolveTypeRef_Ref(BfTypeReference* typeRef, BfPopulateType po
if (genericTypeInst->mGenericTypeInfo->mMaxGenericDepth > 64) if (genericTypeInst->mGenericTypeInfo->mMaxGenericDepth > 64)
{ {
Fail("Maximum generic depth exceeded", typeRef); Fail("Maximum generic depth (64) exceeded", typeRef);
delete genericTypeInst; delete genericTypeInst;
return ResolveTypeResult(typeRef, NULL, populateType, resolveFlags); return ResolveTypeResult(typeRef, NULL, populateType, resolveFlags);
} }