[qfcc] Check for errors in call processing

Wasn't nice getting segfaults in the constructor code due to simple
errors.
This commit is contained in:
Bill Currie 2024-12-11 16:07:43 +09:00
parent a0f09b13cf
commit fc519054f2

View file

@ -451,10 +451,15 @@ proc_branch (const expr_t *expr, rua_ctx_t *ctx)
scoped_src_loc (expr);
if (expr->branch.type == pr_branch_call) {
auto target = expr_process (expr->branch.target, ctx);
if (is_error (target)) {
return target;
}
auto args = (expr_t *) expr->branch.args;
if (expr->branch.args) {
args = new_list_expr (nullptr);
proc_do_list (&args->list, &expr->branch.args->list, ctx);
if (!proc_do_list (&args->list, &expr->branch.args->list, ctx)) {
return new_error_expr ();
}
}
return function_expr (target, args);
} else {