mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed conversion of zero-sized array to span
This commit is contained in:
parent
6eb1b16aa0
commit
75a5a3695b
1 changed files with 9 additions and 2 deletions
|
@ -14556,8 +14556,15 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
if ((convTypedVal.mType->IsWrappableType()) && (wantType == GetWrappedStructType(convTypedVal.mType)))
|
if ((convTypedVal.mType->IsWrappableType()) && (wantType == GetWrappedStructType(convTypedVal.mType)))
|
||||||
{
|
{
|
||||||
convTypedVal = MakeAddressable(convTypedVal);
|
convTypedVal = MakeAddressable(convTypedVal);
|
||||||
methodMatcher.mArguments[0].mTypedValue = BfTypedValue(mBfIRBuilder->CreateBitCast(convTypedVal.mValue, mBfIRBuilder->MapTypeInstPtr(wantType->ToTypeInstance())),
|
if (convTypedVal.mType->IsValuelessType())
|
||||||
paramType, paramType->IsRef() ? BfTypedValueKind_Value : BfTypedValueKind_Addr);
|
{
|
||||||
|
methodMatcher.mArguments[0].mTypedValue = GetDefaultTypedValue(paramType, false, paramType->IsRef() ? BfDefaultValueKind_Value : BfDefaultValueKind_Addr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
methodMatcher.mArguments[0].mTypedValue = BfTypedValue(mBfIRBuilder->CreateBitCast(convTypedVal.mValue, mBfIRBuilder->MapTypeInstPtr(wantType->ToTypeInstance())),
|
||||||
|
paramType, paramType->IsRef() ? BfTypedValueKind_Value : BfTypedValueKind_Addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue