st/mesa: fix uninitialized lower_flrp_progress variable

Submitted by Brian Paul on May 8, 2019, 4:20 p.m.

Details

Message ID 1557332407-22351-1-git-send-email-brianp@vmware.com
State New
Headers show
Series "st/mesa: fix uninitialized lower_flrp_progress variable" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Brian Paul May 8, 2019, 4:20 p.m.
The 'progress' variable is initialized to false in other locations.
This fixes a new Coverity warning.
---
 src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 0a67d45..5706425 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -338,7 +338,7 @@  st_nir_opts(nir_shader *nir, bool scalar)
       NIR_PASS(progress, nir, nir_opt_constant_folding);
 
       if (lower_flrp != 0) {
-         bool lower_flrp_progress;
+         bool lower_flrp_progress = false;
 
          NIR_PASS(lower_flrp_progress, nir, nir_lower_flrp,
                   lower_flrp,

Comments

I sent an MR for this and the other cases earlier this morning.

On May 8, 2019 9:20:16 AM Brian Paul <brianp@vmware.com> wrote:

> The 'progress' variable is initialized to false in other locations.
> This fixes a new Coverity warning.
> ---
> src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
> b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> index 0a67d45..5706425 100644
> --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> @@ -338,7 +338,7 @@ st_nir_opts(nir_shader *nir, bool scalar)
> NIR_PASS(progress, nir, nir_opt_constant_folding);
>
>
> if (lower_flrp != 0) {
> -         bool lower_flrp_progress;
> +         bool lower_flrp_progress = false;
>
>
> NIR_PASS(lower_flrp_progress, nir, nir_lower_flrp,
>          lower_flrp,
> --
> 2.7.4
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev