From 21a7fdf97c3c2ad4119fc478fe0f3f4b90ff411f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 20 May 2020 09:39:45 -0400 Subject: [PATCH] zink: explicitly zero some arrays in ntv just to be safe Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index e609a08caf6..4ba3d9db087 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -614,7 +614,7 @@ get_alu_src_raw(struct ntv_context *ctx, nir_alu_instr *alu, unsigned src) raw_type, used_channels); - SpvId constituents[NIR_MAX_VEC_COMPONENTS]; + SpvId constituents[NIR_MAX_VEC_COMPONENTS] = {0}; for (unsigned i = 0; i < used_channels; ++i) constituents[i] = def; @@ -627,7 +627,7 @@ get_alu_src_raw(struct ntv_context *ctx, nir_alu_instr *alu, unsigned src) raw_type, used_channels); - uint32_t components[NIR_MAX_VEC_COMPONENTS]; + uint32_t components[NIR_MAX_VEC_COMPONENTS] = {0}; size_t num_components = 0; for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) { if (!nir_alu_instr_channel_used(alu, src, i)) -- 2.30.2