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

Kenneth Graunke kenneth at whitecape.org
Tue Sep 24 11:59:09 PDT 2013


On 09/23/2013 10:16 PM, Vinson Lee wrote:
> Fixes "Unintialized scalar field" defect reported by Coverity.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/glsl/lower_jumps.cpp | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/glsl/lower_jumps.cpp b/src/glsl/lower_jumps.cpp
> index 97b1abb..02f65f0 100644
> --- a/src/glsl/lower_jumps.cpp
> +++ b/src/glsl/lower_jumps.cpp
> @@ -281,8 +281,13 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
>     bool lower_main_return;
>  
>     ir_lower_jumps_visitor()
> +      : progress(false),
> +        pull_out_jumps(false),
> +        lower_continue(false),
> +        lower_break(false),
> +        lower_sub_return(false),
> +        lower_main_return(false)
>     {
> -      this->progress = false;
>     }
>  
>     void truncate_after_instruction(exec_node *ir)
> 

Likewise, I wonder if we should make the visitor's constructor take
parameters.

Either way,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list