nir_lower_atomics_to_ssbo: Initialize deref struct
authorGert Wollny <gert.wollny@collabora.com>
Wed, 24 Aug 2022 07:09:10 +0000 (09:09 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 24 Aug 2022 16:02:03 +0000 (16:02 +0000)
commit13355232e4fcd35f73c889751c604180b1454131
treef4c3f45db47cfa6b1770d2b8f6856926c0b0b673
parent8eac45b27446cd9b9eaeb147af97fff1e09832cb
nir_lower_atomics_to_ssbo: Initialize deref struct

This fixes the use of an uninitialzed value:

Conditional jump or move depends on uninitialised value(s)
  bcmp (vg_replace_strmem.c:1203)
  _mesa_add_sized_state_reference (prog_parameter.c:434)
  st_nir_assign_uniform_locations(gl_context*, gl_program*, nir_shader*) (st_glsl_to_nir.cpp:209)
  st_finalize_nir (st_glsl_to_nir.cpp:1041)
  by 0x58271B9: st_glsl_to_nir_post_opts(st_context*, gl_program*, gl_shader_program*) (st_glsl_to_nir.cpp:571)
  ...
Uninitialised value was created by a heap allocation
  malloc (vg_replace_malloc.c:381)
  ralloc_size (ralloc.c:114)
  ralloc_array_size (ralloc.c:218)
  deref_offset_var (nir_lower_atomics_to_ssbo.c:47)
  lower_instr (nir_lower_atomics_to_ssbo.c:111)
  nir_lower_atomics_to_ssbo (nir_lower_atomics_to_ssbo.c:204)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18227>
src/compiler/nir/nir_lower_atomics_to_ssbo.c