1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed tuple ToString with pointer member

This commit is contained in:
Brian Fiete 2025-01-21 08:45:43 -08:00
parent 4054a67ee1
commit 5000fa9843

View file

@ -19188,7 +19188,6 @@ void BfModule::EmitTupleToStringBody()
continue; continue;
BfTypedValue fieldValue = ExtractValue(thisValue, &fieldInstance, fieldInstance.mDataIdx); BfTypedValue fieldValue = ExtractValue(thisValue, &fieldInstance, fieldInstance.mDataIdx);
if (fieldValue.mType->IsWrappableType()) if (fieldValue.mType->IsWrappableType())
{ {
auto wrappedType = GetWrappedStructType(fieldValue.mType); auto wrappedType = GetWrappedStructType(fieldValue.mType);
@ -19198,7 +19197,7 @@ void BfModule::EmitTupleToStringBody()
} }
else else
{ {
fieldValue = MakeAddressable(fieldValue); fieldValue = MakeAddressable(fieldValue, false, true);
fieldValue.mType = wrappedType; fieldValue.mType = wrappedType;
fieldValue.mValue = mBfIRBuilder->CreateBitCast(fieldValue.mValue, mBfIRBuilder->MapTypeInstPtr(fieldValue.mType->ToTypeInstance())); fieldValue.mValue = mBfIRBuilder->CreateBitCast(fieldValue.mValue, mBfIRBuilder->MapTypeInstPtr(fieldValue.mType->ToTypeInstance()));
if (!wrappedType->IsValuelessType()) if (!wrappedType->IsValuelessType())