From 0fdd6de65f8a212e6c504e577806eabe116a1fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 12 Jul 2025 02:34:47 -0400 Subject: [PATCH] nir/lower_io: validate locations more accurately Reviewed-by: Alyssa Rosenzweig Reviewed-by: Timothy Arceri Part-of: --- src/compiler/nir/nir_lower_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 8dbf9bfd0b9..b8ad28e4edd 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -324,8 +324,8 @@ emit_load(struct lower_io_state *state, unsigned num_slots = get_number_of_slots(state, var); /* Maximum values in nir_io_semantics. */ - assert(location >= 0 && location <= 127); assert(num_slots <= 63); + assert(location >= 0 && location + num_slots <= NUM_TOTAL_VARYING_SLOTS); nir_io_semantics semantics = { 0 }; semantics.location = location; @@ -489,8 +489,8 @@ emit_store(struct lower_io_state *state, nir_def *data, unsigned num_slots = get_number_of_slots(state, var); /* Maximum values in nir_io_semantics. */ - assert(location >= 0 && location <= 127); assert(num_slots <= 63); + assert(location >= 0 && location + num_slots <= NUM_TOTAL_VARYING_SLOTS); nir_io_semantics semantics = { 0 }; semantics.location = location;