Mesa (master): zink: explicitly zero some arrays in ntv

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 22 13:38:24 UTC 2020


Module: Mesa
Branch: master
Commit: 21a7fdf97c3c2ad4119fc478fe0f3f4b90ff411f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21a7fdf97c3c2ad4119fc478fe0f3f4b90ff411f

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed May 20 09:39:45 2020 -0400

zink: explicitly zero some arrays in ntv

just to be safe

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5120>

---

 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))



More information about the mesa-commit mailing list