zink: explicitly zero some arrays in ntv
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 20 May 2020 13:39:45 +0000 (09:39 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 22 May 2020 13:24:10 +0000 (13:24 +0000)
just to be safe

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

src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c

index e609a08caf61dacc45b2733e67dd3da2e940581f..4ba3d9db0878a9be40e0e047088b61fd7d87cf94 100644 (file)
@@ -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))