mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +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)))
|
||||
{
|
||||
convTypedVal = MakeAddressable(convTypedVal);
|
||||
methodMatcher.mArguments[0].mTypedValue = BfTypedValue(mBfIRBuilder->CreateBitCast(convTypedVal.mValue, mBfIRBuilder->MapTypeInstPtr(wantType->ToTypeInstance())),
|
||||
paramType, paramType->IsRef() ? BfTypedValueKind_Value : BfTypedValueKind_Addr);
|
||||
if (convTypedVal.mType->IsValuelessType())
|
||||
{
|
||||
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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue