From: Kristian H. Kristensen Date: Wed, 10 Apr 2019 20:10:48 +0000 (-0700) Subject: glsl_to_nir: Initialize debug variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15605cc9d481dccc8f4dff0e6471600809d56980;p=mesa.git 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 Reviewed-by: Ian Romanick --- 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];