From 8f9785c3da7b120423df56914d54d9fb2aeb2b26 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 4 Sep 2024 09:54:29 +0900 Subject: [PATCH] [qfcc] Handle type function parameters in type functions The code assumed an actual type reference, not a type function, resulting in a segfault for `@vector(bool,@width(vec))`. --- tools/qfcc/source/expr_type.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qfcc/source/expr_type.c b/tools/qfcc/source/expr_type.c index db18f4acd..bd4221fab 100644 --- a/tools/qfcc/source/expr_type.c +++ b/tools/qfcc/source/expr_type.c @@ -72,7 +72,7 @@ check_int (const expr_t *arg) && arg->type != ex_type) { return false; } - int op = arg->symbol->expr->typ.op; + int op = arg->type ? arg->typ.op : arg->symbol->expr->typ.op; if (op != QC_AT_WIDTH && op != QC_AT_ROWS && op != QC_AT_COLS) { return false; }