mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed autoprops in structs
This commit is contained in:
parent
01f82d1250
commit
f505c9b6aa
2 changed files with 6 additions and 1 deletions
|
@ -2115,6 +2115,11 @@ void BeIRCodeGen::HandleNextCmd()
|
||||||
case BfIRCmd_CreateRet:
|
case BfIRCmd_CreateRet:
|
||||||
{
|
{
|
||||||
CMD_PARAM(BeValue*, val);
|
CMD_PARAM(BeValue*, val);
|
||||||
|
#ifdef _DEBUG
|
||||||
|
auto retType = val->GetType();
|
||||||
|
auto funcType = mActiveFunction->GetFuncType();
|
||||||
|
BF_ASSERT(retType == funcType->mReturnType);
|
||||||
|
#endif
|
||||||
SetResult(curId, mBeModule->CreateRet(val));
|
SetResult(curId, mBeModule->CreateRet(val));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -17532,7 +17532,7 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
|
||||||
else if (mCurTypeInstance->IsObject())
|
else if (mCurTypeInstance->IsObject())
|
||||||
lookupValue = BfTypedValue(mBfIRBuilder->CreateInBoundsGEP(GetThis().mValue, 0, fieldInstance->mDataIdx), fieldInstance->mResolvedType, true);
|
lookupValue = BfTypedValue(mBfIRBuilder->CreateInBoundsGEP(GetThis().mValue, 0, fieldInstance->mDataIdx), fieldInstance->mResolvedType, true);
|
||||||
else
|
else
|
||||||
lookupValue = ExtractValue(GetThis(), fieldInstance, fieldInstance->mFieldIdx);
|
lookupValue = ExtractValue(GetThis(), fieldInstance, fieldInstance->mDataIdx);
|
||||||
lookupValue = LoadOrAggregateValue(lookupValue);
|
lookupValue = LoadOrAggregateValue(lookupValue);
|
||||||
CreateReturn(lookupValue.mValue);
|
CreateReturn(lookupValue.mValue);
|
||||||
EmitLifetimeEnds(&mCurMethodState->mHeadScope);
|
EmitLifetimeEnds(&mCurMethodState->mHeadScope);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue