[Mesa-dev] [PATCH v2 08/32] nir: Zero nir_load_const_instr::value for valgrind & nir_serialize

Kenneth Graunke kenneth at whitecape.org
Thu Oct 19 23:54:36 UTC 2017


On Wednesday, October 18, 2017 10:31:56 PM PDT Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/compiler/nir/nir.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
> index fe48451694..cbba9c8749 100644
> --- a/src/compiler/nir/nir.c
> +++ b/src/compiler/nir/nir.c
> @@ -481,6 +481,7 @@ nir_load_const_instr_create(nir_shader *shader, unsigned num_components,
>                              unsigned bit_size)
>  {
>     nir_load_const_instr *instr = ralloc(shader, nir_load_const_instr);
> +   memset(&instr->value, 0, sizeof(instr->value));

I would just rzalloc here.  Preemptively, that patch would get a:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

>     instr_init(&instr->instr, nir_instr_type_load_const);
>  
>     nir_ssa_def_init(&instr->instr, &instr->def, num_components, bit_size, NULL);
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171019/ab5b6d3a/attachment.sig>


More information about the mesa-dev mailing list