From 4f243c53a743a9585016e058d4f24e906191a421 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 28 Dec 2020 11:41:12 -0800 Subject: [PATCH] Fixed byval size --- IDEHelper/Compiler/BfExprEvaluator.cpp | 2 +- IDEHelper/Compiler/BfModule.cpp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index a7f8776a..d4d30bc4 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -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); } } } diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 133285c6..6d9ac2da 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -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())