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

Sized-array calling convention fix

This commit is contained in:
Brian Fiete 2020-12-28 06:42:18 -08:00
parent 80fcf84de2
commit 8a63a7ed80
5 changed files with 17 additions and 5 deletions

View file

@ -15676,10 +15676,11 @@ void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func
PopulateType(resolvedTypeRef, BfPopulateType_Data);
addDeref = resolvedTypeRef->mSize;
}
else if (methodInstance->WantsStructsAttribByVal())
else if ((methodInstance->WantsStructsAttribByVal()) && (!resolvedTypeRef->IsSizedArray()))
{
mBfIRBuilder->PopulateType(resolvedTypeRef);
mBfIRBuilder->Func_AddAttribute(func, argIdx + 1, BfIRAttribute_ByVal, mSystem->mPtrSize);
BF_ASSERT(resolvedTypeRef->mAlign > 0);
mBfIRBuilder->Func_AddAttribute(func, argIdx + 1, BfIRAttribute_ByVal, resolvedTypeRef->mAlign);
}
}
else if (resolvedTypeRef->IsPrimitiveType())