1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +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

@ -5371,9 +5371,9 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_NoCapture);
addDeref = paramType->mSize;
}
else if (methodInstance->WantsStructsAttribByVal())
else if ((methodInstance->WantsStructsAttribByVal()) && (!paramType->IsSizedArray()))
{
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_ByVal, mModule->mSystem->mPtrSize);
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_ByVal, paramType->mAlign);
}
}
}