From 0ac55b786ac357a468ca918fc848c7fe68edfc6c Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Tue, 28 Oct 2025 14:30:11 +0100 Subject: [PATCH] spirv: don't set in_bounds for structs The arr::in_bounds field was set unconditionally for every deref created for a chain. For struct derefs, which don't have this field, this would write to an unused memory location, which is probably why this never caused issues. Signed-off-by: Job Noorman Fixes: f19cbe98e32 ("nir,spirv: Preserve inbounds access information") Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/spirv/vtn_variables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index c109aac1da3..55557e7a910 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -506,8 +506,8 @@ vtn_pointer_dereference(struct vtn_builder *b, type = type->array_element; } tail = nir_build_deref_array(&b->nb, tail, arr_index); + tail->arr.in_bounds = deref_chain->in_bounds; } - tail->arr.in_bounds = deref_chain->in_bounds; access |= type->access; }