mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Null conditional fixes
This commit is contained in:
parent
bb66c77da8
commit
f6752b703d
4 changed files with 15 additions and 1 deletions
|
@ -6886,9 +6886,16 @@ BfTypedValue BfModule::FlushNullConditional(BfTypedValue result, bool ignoreNull
|
|||
AddBasicBlock(pendingNullCond->mDoneBB);
|
||||
if (nullableType == NULL)
|
||||
{
|
||||
auto phi = mBfIRBuilder->CreatePhi(mBfIRBuilder->MapType(result.mType), 2);
|
||||
auto phi = mBfIRBuilder->CreatePhi(mBfIRBuilder->MapType(result.mType), 1 + (int)pendingNullCond->mNotNullBBs.size());
|
||||
mBfIRBuilder->AddPhiIncoming(phi, result.mValue, notNullBB);
|
||||
|
||||
mBfIRBuilder->AddPhiIncoming(phi, GetDefaultValue(result.mType), pendingNullCond->mCheckBB);
|
||||
for (int notNullIdx = 0; notNullIdx < (int)pendingNullCond->mNotNullBBs.size() - 1; notNullIdx++)
|
||||
{
|
||||
auto prevNotNullBB = pendingNullCond->mNotNullBBs[notNullIdx];
|
||||
mBfIRBuilder->AddPhiIncoming(phi, GetDefaultValue(result.mType), prevNotNullBB);
|
||||
}
|
||||
|
||||
result.mValue = phi;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue