[qfcc] Check for errors in conditional expressions

This commit is contained in:
Bill Currie 2024-11-24 15:52:17 +09:00
parent 53c4c205ca
commit 70bb5c3434

View file

@ -339,6 +339,15 @@ proc_cond (const expr_t *expr)
auto test = expr_process (expr->cond.test);
auto true_expr = expr_process (expr->cond.true_expr);
auto false_expr = expr_process (expr->cond.false_expr);
if (is_error (test)) {
return test;
}
if (is_error (true_expr)) {
return true_expr;
}
if (is_error (false_expr)) {
return false_expr;
}
return new_cond_expr (test, true_expr, false_expr);
}