Mesa (master): glsl_to_nir: Initialize debug variable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 19 16:29:19 UTC 2019


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

Author: Kristian H. Kristensen <hoegsberg at chromium.org>
Date:   Wed Apr 10 13:10:48 2019 -0700

glsl_to_nir: Initialize debug variable

If we want to assert on found == true when the loop exits early, we
need to initialize it to false.

Signed-off-by: Kristian H. Kristensen <hoegsberg at chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/compiler/glsl/glsl_to_nir.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 547764982dc..0aeac769452 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -523,7 +523,7 @@ nir_visitor::visit(ir_variable *ir)
          var->type = wrap_type_in_array(explicit_ifc_type, ir->type);
       } else {
          /* Otherwise, this variable is one entry in the interface */
-         UNUSED bool found;
+         UNUSED bool found = false;
          for (unsigned i = 0; i < explicit_ifc_type->length; i++) {
             const glsl_struct_field *field =
                &explicit_ifc_type->fields.structure[i];




More information about the mesa-commit mailing list