[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))`.
This commit is contained in:
Bill Currie 2024-09-04 09:54:29 +09:00
parent cd7abf5320
commit 8f9785c3da

View file

@ -72,7 +72,7 @@ check_int (const expr_t *arg)
&& arg->type != ex_type) { && arg->type != ex_type) {
return false; 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) { if (op != QC_AT_WIDTH && op != QC_AT_ROWS && op != QC_AT_COLS) {
return false; return false;
} }