From a15c1e1896f31f3078585ac105924ab18d331996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 19 Jan 2025 00:03:01 -0500 Subject: [PATCH] nir: silence a warning in nir_opt_shrink_vectors gcc assumes the array is a string, so it treats it as having 15 elements instead of 16. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_opt_shrink_vectors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_shrink_vectors.c b/src/compiler/nir/nir_opt_shrink_vectors.c index 6fb92600dd7..e3ce2d624b3 100644 --- a/src/compiler/nir/nir_opt_shrink_vectors.c +++ b/src/compiler/nir/nir_opt_shrink_vectors.c @@ -135,7 +135,7 @@ shrink_dest_to_read_mask(nir_def *def, bool shrink_start) /* Reswizzle sources, which must be ALU since they have swizzle */ assert(first_bit + comps <= NIR_MAX_VEC_COMPONENTS); - uint8_t swizzle[NIR_MAX_VEC_COMPONENTS] = { 0 }; + uint8_t swizzle[NIR_MAX_VEC_COMPONENTS + 1] = { 0 }; for (unsigned i = 0; i < comps; ++i) { swizzle[first_bit + i] = i; }