From fc519054f2b6883a5943ba88189ba133acbe3a6c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 11 Dec 2024 16:07:43 +0900 Subject: [PATCH] [qfcc] Check for errors in call processing Wasn't nice getting segfaults in the constructor code due to simple errors. --- tools/qfcc/source/expr_process.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/expr_process.c b/tools/qfcc/source/expr_process.c index 829d27c97..cfa319a55 100644 --- a/tools/qfcc/source/expr_process.c +++ b/tools/qfcc/source/expr_process.c @@ -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 {