From 0426879bf60119f3b7cc6dbe4ca701fc32268bcf Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 4 Jan 2021 14:54:04 +0900 Subject: [PATCH] [qfcc] Check returned type instead of expr type Block expressions hide ex_error, but get_type() always returns null when it finds one (which it does by recursing into block expression), so just check the type itself. --- tools/qfcc/source/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 9ecf0ad15..a8684a83b 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -2075,7 +2075,7 @@ return_expr (function_t *f, expr_t *e) t = get_type (e); - if (e->type == ex_error) { + if (!t) { return e; } if (is_void(ret_type)) {