From 58b78cfdec209a58afae118707427a08447e10e7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 3 Dec 2024 14:56:38 +0900 Subject: [PATCH] [qfcc] Separate matrices from non-scalars While matrices are non-scalars in math, is_nonscalar is meant for any vector type because is_vector is specifically for the quakec vector type. --- tools/qfcc/source/type.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 86d047fe0..f5fb70dfd 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -1555,6 +1555,11 @@ is_nonscalar (const type_t *type) if (type->width < 2) { return false; } + if (type->columns > 1) { + // while matrices are technically non-scalar, treat them as both + // niether scalar nor non-scalar for type checking + return false; + } return is_real (type) || is_integral (type) || is_boolean (type); }