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

Assert fix, comptime valueless return fix

This commit is contained in:
Brian Fiete 2021-11-03 07:48:01 -07:00
parent 613aa116f4
commit a9872fcbac
2 changed files with 8 additions and 4 deletions

View file

@ -4347,6 +4347,7 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
{ {
if (fieldInstance->mResolvedType->IsUndefSizedArray()) if (fieldInstance->mResolvedType->IsUndefSizedArray())
{ {
if ((!mBfIRBuilder->mIgnoreWrites) && (!mCompiler->mFastFinish))
AssertErrorState(); AssertErrorState();
} }
else else
@ -15141,7 +15142,10 @@ void BfModule::EmitReturn(const BfTypedValue& val)
} }
else if (mIsComptimeModule) else if (mIsComptimeModule)
{ {
if (!val.mType->IsValuelessType())
mBfIRBuilder->CreateSetRet(val.mValue, val.mType->mTypeId); mBfIRBuilder->CreateSetRet(val.mValue, val.mType->mTypeId);
else
mBfIRBuilder->CreateSetRet(BfIRValue(), val.mType->mTypeId);
} }
else else
{ {

View file

@ -3239,7 +3239,7 @@ void CeContext::PrepareConstStructEntry(CeConstStructData& constEntry)
{ {
if (constEntry.mHash.IsZero()) 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()) if (!constEntry.mFixups.IsEmpty())
constEntry.mHash = Hash128(&constEntry.mFixups[0], constEntry.mFixups.mSize * sizeof(CeConstStructFixup), constEntry.mHash); constEntry.mHash = Hash128(&constEntry.mFixups[0], constEntry.mFixups.mSize * sizeof(CeConstStructFixup), constEntry.mHash);
} }