2
0
Эх сурвалжийг харах

Fixed valueless case in MakeCallableTarget

Brian Fiete 6 сар өмнө
parent
commit
0e79860ba9

+ 4 - 1
IDEHelper/Compiler/BfExprEvaluator.cpp

@@ -17335,7 +17335,10 @@ BfTypedValue BfExprEvaluator::MakeCallableTarget(BfAstNode* targetSrc, BfTypedVa
 			else if (target.IsAddr())
 			{
 				auto ptrType = mModule->CreatePointerType(primStructType);
-				target = BfTypedValue(mModule->mBfIRBuilder->CreateBitCast(target.mValue, mModule->mBfIRBuilder->MapType(ptrType)), primStructType, true);
+				if (primStructType->IsValuelessType())
+					target = BfTypedValue(target.mValue, primStructType, true);
+				else
+					target = BfTypedValue(mModule->mBfIRBuilder->CreateBitCast(target.mValue, mModule->mBfIRBuilder->MapType(ptrType)), primStructType, true);
 			}
 			else if ((primStructType->IsSplattable()) && (target.IsSplat()) && (!IsComptime()))
 			{