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

@ -4753,9 +4753,6 @@ BfIRValue BfModule::CreateClassVDataGlobal(BfTypeInstance* typeInstance, int* ou
classVDataName); classVDataName);
mClassVDataRefs[typeInstance] = globalVariable; mClassVDataRefs[typeInstance] = globalVariable;
if (mCurTypeInstance != NULL)
AddDependency(typeInstance, mCurTypeInstance, BfDependencyMap::DependencyFlag_StaticValue);
} }
return globalVariable; return globalVariable;
} }
@ -15691,7 +15688,7 @@ void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func
{ {
mBfIRBuilder->PopulateType(resolvedTypeRef); mBfIRBuilder->PopulateType(resolvedTypeRef);
BF_ASSERT(resolvedTypeRef->mAlign > 0); 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()) else if (resolvedTypeRef->IsPrimitiveType())