1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Fixed sized array cast

This commit is contained in:
Brian Fiete 2021-01-04 11:22:18 -08:00
parent 7063846ef6
commit a179dd7e5c

View file

@ -8835,11 +8835,18 @@ void BfExprEvaluator::LookupQualifiedName(BfAstNode* nameNode, BfIdentifierNode*
{ {
if (mResult.mType->IsSizedArray()) if (mResult.mType->IsSizedArray())
{ {
mResult.mType = mModule->GetWrappedStructType(mResult.mType);
if (mResult.mType->IsValuelessType()) if (mResult.mType->IsValuelessType())
{
mResult.mType = mModule->GetWrappedStructType(mResult.mType);
mResult.mValue = mModule->mBfIRBuilder->GetFakeVal(); mResult.mValue = mModule->mBfIRBuilder->GetFakeVal();
}
else else
{
mResult = mModule->MakeAddressable(mResult);
mResult.mType = mModule->GetWrappedStructType(mResult.mType);
mResult.mValue = mModule->mBfIRBuilder->CreateBitCast(mResult.mValue, mModule->mBfIRBuilder->MapTypeInstPtr(mResult.mType->ToTypeInstance())); mResult.mValue = mModule->mBfIRBuilder->CreateBitCast(mResult.mValue, mModule->mBfIRBuilder->MapTypeInstPtr(mResult.mType->ToTypeInstance()));
}
} }
else if (mResult.mType->IsWrappableType()) else if (mResult.mType->IsWrappableType())
{ {