[Async Refactoring] Add missing null type check

Don't crash if we have a boolean condition without
a type, as that may occur in invalid code.

rdar://79864182
This commit is contained in:
Hamish Knight
2021-06-28 16:03:54 +01:00
parent efd9c45d43
commit 0d4eb978da
2 changed files with 16 additions and 1 deletions

View File

@@ -4536,7 +4536,8 @@ struct CallbackCondition {
/// A bool condition expression.
explicit CallbackCondition(const Expr *E) {
if (!E->getType()->isBool())
// FIXME: Sema should produce ErrorType.
if (!E->getType() || !E->getType()->isBool())
return;
auto CondType = ConditionType::IS_TRUE;