[Mesa-dev] [PATCH] glsl: Initialize lower_vector_visitor::dont_lower_swz in constructor.
Ian Romanick
idr at freedesktop.org
Tue May 22 14:44:59 PDT 2012
On 05/13/2012 12:48 AM, Vinson Lee wrote:
> Fix 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 57963a1..6f031d5 100644
> --- a/src/glsl/lower_vector.cpp
> +++ b/src/glsl/lower_vector.cpp
> @@ -33,7 +33,7 @@
>
> class lower_vector_visitor : public ir_rvalue_visitor {
> public:
> - lower_vector_visitor() : progress(false)
> + lower_vector_visitor() : dont_lower_swz(false), progress(false)
> {
> /* empty */
> }
I actually think it would be better to make dont_lower_swz a parameter
to the constructor. There is only one instance of a
lower_vector_visitor object, and dont_lower_swz is set immediately after
it is instantiated. I have no idea why I structured the code like that
in the first place. :(
More information about the mesa-dev
mailing list