glsl_to_nir: Initialize debug variable
authorKristian H. Kristensen <hoegsberg@chromium.org>
Wed, 10 Apr 2019 20:10:48 +0000 (13:10 -0700)
committerKristian H. Kristensen <hoegsberg@gmail.com>
Fri, 19 Apr 2019 16:17:37 +0000 (16:17 +0000)
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@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/glsl_to_nir.cpp

index 547764982dcf6d0cc7f9417ac2d96f06f774d250..0aeac769452a78d85ddb93eeaa9c6c5c9fdb7087 100644 (file)
@@ -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];