From 1e0a0b4dd5b719a2cbdd0c06d0c367e222163d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Mon, 3 Jun 2024 08:38:09 -0700 Subject: [PATCH] anv: Initialize variable to fix static analyzer warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static analyzer is complaning that tex_src could be not initialized and then used, this should not happen as an instruction with type of 'tex' type needs to have source a texture handle. But to make static analyzer happy here just initializing it to zero. Reviewed-by: Sagar Ghuge Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index dc049697234..de9507bd508 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -970,7 +970,7 @@ print_tex_handle(nir_builder *b, nir_tex_instr *tex = nir_instr_as_tex(instr); - nir_src tex_src; + nir_src tex_src = {}; for (unsigned i = 0; i < tex->num_srcs; i++) { if (tex->src[i].src_type == nir_tex_src_texture_handle) tex_src = tex->src[i].src;