From a179dd7e5c1f9b18ac312041df1940ed49299079 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 4 Jan 2021 11:22:18 -0800 Subject: [PATCH] Fixed sized array cast --- IDEHelper/Compiler/BfExprEvaluator.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 20e10f3b..89db0970 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -8835,11 +8835,18 @@ void BfExprEvaluator::LookupQualifiedName(BfAstNode* nameNode, BfIdentifierNode* { if (mResult.mType->IsSizedArray()) { - mResult.mType = mModule->GetWrappedStructType(mResult.mType); + if (mResult.mType->IsValuelessType()) + { + mResult.mType = mModule->GetWrappedStructType(mResult.mType); mResult.mValue = mModule->mBfIRBuilder->GetFakeVal(); + } else + { + mResult = mModule->MakeAddressable(mResult); + mResult.mType = mModule->GetWrappedStructType(mResult.mType); mResult.mValue = mModule->mBfIRBuilder->CreateBitCast(mResult.mValue, mModule->mBfIRBuilder->MapTypeInstPtr(mResult.mType->ToTypeInstance())); + } } else if (mResult.mType->IsWrappableType()) {