[Mesa-dev] [PATCH] glsl: Initialize assignment_generator member variables.

Ian Romanick idr at freedesktop.org
Tue Sep 24 11:17:01 PDT 2013


On 09/23/2013 10:06 PM, Vinson Lee wrote:
> Fixes "Uninitialized pointer field" defect reported by Coverity.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/glsl/lower_variable_index_to_cond_assign.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/glsl/lower_variable_index_to_cond_assign.cpp b/src/glsl/lower_variable_index_to_cond_assign.cpp
> index 21674b5..8086c03 100644
> --- a/src/glsl/lower_variable_index_to_cond_assign.cpp
> +++ b/src/glsl/lower_variable_index_to_cond_assign.cpp
> @@ -192,6 +192,12 @@ struct assignment_generator
>     ir_variable* var;
>  
>     assignment_generator()
> +     : base_ir(NULL),
> +       rvalue(NULL),
> +       old_index(NULL),
> +       is_write(false),
> +       write_mask(0),
> +       var(NULL)

We should establish (and document) a coding convention here.  Other
places put a bunch of initializers on a single line.  I can see
arguments for either way, but we should pick one.

Paul, Ken, Curro: Preferences?

>     {
>     }
>  
> 



More information about the mesa-dev mailing list