mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Assert fix, comptime valueless return fix
This commit is contained in:
parent
613aa116f4
commit
a9872fcbac
2 changed files with 8 additions and 4 deletions
|
@ -4347,7 +4347,8 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
|
|||
{
|
||||
if (fieldInstance->mResolvedType->IsUndefSizedArray())
|
||||
{
|
||||
AssertErrorState();
|
||||
if ((!mBfIRBuilder->mIgnoreWrites) && (!mCompiler->mFastFinish))
|
||||
AssertErrorState();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -15141,12 +15142,15 @@ void BfModule::EmitReturn(const BfTypedValue& val)
|
|||
}
|
||||
else if (mIsComptimeModule)
|
||||
{
|
||||
mBfIRBuilder->CreateSetRet(val.mValue, val.mType->mTypeId);
|
||||
if (!val.mType->IsValuelessType())
|
||||
mBfIRBuilder->CreateSetRet(val.mValue, val.mType->mTypeId);
|
||||
else
|
||||
mBfIRBuilder->CreateSetRet(BfIRValue(), val.mType->mTypeId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just ignore
|
||||
BF_ASSERT(mCurMethodInstance->mReturnType->IsVar());
|
||||
BF_ASSERT(mCurMethodInstance->mReturnType->IsVar());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3239,7 +3239,7 @@ void CeContext::PrepareConstStructEntry(CeConstStructData& constEntry)
|
|||
{
|
||||
if (constEntry.mHash.IsZero())
|
||||
{
|
||||
constEntry.mHash = Hash128(&constEntry.mData[0], constEntry.mData.mSize);
|
||||
constEntry.mHash = Hash128(constEntry.mData.mVals, constEntry.mData.mSize);
|
||||
if (!constEntry.mFixups.IsEmpty())
|
||||
constEntry.mHash = Hash128(&constEntry.mFixups[0], constEntry.mFixups.mSize * sizeof(CeConstStructFixup), constEntry.mHash);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue