[Mesa-dev] [PATCH] glsl: Initialize lower_vector_visitor::dont_lower_swz.

Kenneth Graunke kenneth at whitecape.org
Tue Sep 24 12:01:43 PDT 2013


On 09/23/2013 09:58 PM, Vinson Lee wrote:
> Fixes "Uninitialized scalar field" defect reported by Coverity.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/glsl/lower_vector.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/lower_vector.cpp b/src/glsl/lower_vector.cpp
> index 9172b6a..a658410 100644
> --- a/src/glsl/lower_vector.cpp
> +++ b/src/glsl/lower_vector.cpp
> @@ -35,7 +35,7 @@ namespace {
>  
>  class lower_vector_visitor : public ir_rvalue_visitor {
>  public:
> -   lower_vector_visitor() : progress(false)
> +   lower_vector_visitor() : dont_lower_swz(false), progress(false)
>     {
>        /* empty */
>     }
> 

Same comment here - maybe pass dont_lower_swiz as an argument.

The nice thing about that is you're actually initializing it to a real
value, rather than setting it to false on creation and immediately
setting it again.

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


More information about the mesa-dev mailing list