Mesa (master): freedreno/ir3: Fix uninit var warning.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 14 04:04:32 UTC 2020


Module: Mesa
Branch: master
Commit: 5c1afd1ce43b8d40a14845b2b026924709956405
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c1afd1ce43b8d40a14845b2b026924709956405

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jul  8 13:49:31 2020 -0700

freedreno/ir3: Fix uninit var warning.

It's a decent bit of analysis to see that the initialization will always
happen, and my compiler isn't doing so in at least one configuration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5834>

---

 src/freedreno/ir3/ir3_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c
index 9771c66faf6..6ecce8fb290 100644
--- a/src/freedreno/ir3/ir3_shader.c
+++ b/src/freedreno/ir3/ir3_shader.c
@@ -400,7 +400,7 @@ trim_constlens(unsigned *constlens,
       cur_total += constlens[i];
    }
 
-   unsigned max_stage;
+   unsigned max_stage = 0;
    unsigned max_const = 0;
    uint32_t trimmed = 0;
 



More information about the mesa-commit mailing list