mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed phi with var failure value
This commit is contained in:
parent
8647d63806
commit
efa44caee0
1 changed files with 10 additions and 3 deletions
|
@ -16042,9 +16042,16 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
|||
BfIRValue phi;
|
||||
if (!trueValue.mType->IsValuelessType())
|
||||
{
|
||||
phi = mModule->mBfIRBuilder->CreatePhi(mModule->mBfIRBuilder->MapType(trueValue.mType), 2);
|
||||
mModule->mBfIRBuilder->AddPhiIncoming(phi, trueValue.mValue, trueBlockPos);
|
||||
mModule->mBfIRBuilder->AddPhiIncoming(phi, falseValue.mValue, falseBlockPos);
|
||||
if (trueValue.mType->IsVar())
|
||||
{
|
||||
phi = mModule->mBfIRBuilder->GetFakeVal();
|
||||
}
|
||||
else
|
||||
{
|
||||
phi = mModule->mBfIRBuilder->CreatePhi(mModule->mBfIRBuilder->MapType(trueValue.mType), 2);
|
||||
mModule->mBfIRBuilder->AddPhiIncoming(phi, trueValue.mValue, trueBlockPos);
|
||||
mModule->mBfIRBuilder->AddPhiIncoming(phi, falseValue.mValue, falseBlockPos);
|
||||
}
|
||||
}
|
||||
mModule->mBfIRBuilder->CreateBr(contBB);
|
||||
mModule->AddBasicBlock(contBB);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue