mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fix for deferring evaluation of conditionals with nulls for nullables
This commit is contained in:
parent
d7aa91f9c5
commit
a8d57c5d28
1 changed files with 5 additions and 2 deletions
|
@ -16,6 +16,7 @@ void BfDeferEvalChecker::Visit(BfLiteralExpression* literalExpr)
|
||||||
{
|
{
|
||||||
switch (literalExpr->mValue.mTypeCode)
|
switch (literalExpr->mValue.mTypeCode)
|
||||||
{
|
{
|
||||||
|
case BfTypeCode_NullPtr:
|
||||||
case BfTypeCode_Boolean:
|
case BfTypeCode_Boolean:
|
||||||
case BfTypeCode_Char8:
|
case BfTypeCode_Char8:
|
||||||
case BfTypeCode_Int8:
|
case BfTypeCode_Int8:
|
||||||
|
@ -83,8 +84,10 @@ void BfDeferEvalChecker::Visit(BfInvocationExpression* invocationExpr)
|
||||||
|
|
||||||
void BfDeferEvalChecker::Visit(BfConditionalExpression* condExpr)
|
void BfDeferEvalChecker::Visit(BfConditionalExpression* condExpr)
|
||||||
{
|
{
|
||||||
VisitChild(condExpr->mTrueExpression);
|
VisitChild(condExpr->mConditionExpression);
|
||||||
bool prev = mNeedsDeferEval;
|
bool prev = mNeedsDeferEval;
|
||||||
|
VisitChild(condExpr->mTrueExpression);
|
||||||
|
prev |= mNeedsDeferEval;
|
||||||
VisitChild(condExpr->mFalseExpression);
|
VisitChild(condExpr->mFalseExpression);
|
||||||
mNeedsDeferEval |= prev;
|
mNeedsDeferEval |= prev;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue