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

Fixed byval size

This commit is contained in:
Brian Fiete 2020-12-28 11:41:12 -08:00
parent 91b046b6d7
commit 4f243c53a7
2 changed files with 3 additions and 6 deletions

View file

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

View file

@ -4752,10 +4752,7 @@ BfIRValue BfModule::CreateClassVDataGlobal(BfTypeInstance* typeInstance, int* ou
BfIRValue(),
classVDataName);
mClassVDataRefs[typeInstance] = globalVariable;
if (mCurTypeInstance != NULL)
AddDependency(typeInstance, mCurTypeInstance, BfDependencyMap::DependencyFlag_StaticValue);
mClassVDataRefs[typeInstance] = globalVariable;
}
return globalVariable;
}
@ -15691,7 +15688,7 @@ void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func
{
mBfIRBuilder->PopulateType(resolvedTypeRef);
BF_ASSERT(resolvedTypeRef->mAlign > 0);
mBfIRBuilder->Func_AddAttribute(func, argIdx + 1, BfIRAttribute_ByVal, resolvedTypeRef->mAlign);
mBfIRBuilder->Func_AddAttribute(func, argIdx + 1, BfIRAttribute_ByVal, mSystem->mPtrSize);
}
}
else if (resolvedTypeRef->IsPrimitiveType())