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

2017-10-19 Thread Kenneth Graunke
On Wednesday, October 18, 2017 10:31:56 PM PDT Jordan Justen wrote:
> Signed-off-by: Jordan Justen 
> ---
>  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(>value, 0, sizeof(instr->value));

I would just rzalloc here.  Preemptively, that patch would get a:
Reviewed-by: Kenneth Graunke 

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



signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-10-18 Thread Jordan Justen
Signed-off-by: Jordan Justen 
---
 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(>value, 0, sizeof(instr->value));
instr_init(>instr, nir_instr_type_load_const);
 
nir_ssa_def_init(>instr, >def, num_components, bit_size, 
NULL);
-- 
2.15.0.rc0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev