From 831eff15f8c3b613a7e532d938fec08533c71886 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 26 Jan 2021 14:01:26 -0500 Subject: [PATCH] glsl: Silence a warning at -Og MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ../src/compiler/glsl/gl_nir_link_uniforms.c: In function ‘gl_nir_link_uniforms’: ../src/compiler/glsl/gl_nir_link_uniforms.c:1747:39: warning: ‘num_blocks’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1747 | for (unsigned i = 0; i < num_blocks; i++) { Don't have the patience to seee how you'd hit this but doing nothing is clearly the right edge case behavior. Reviewed-by: Eric Anholt Part-of: --- src/compiler/glsl/gl_nir_link_uniforms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index 005f992..45643e8 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -1652,7 +1652,7 @@ gl_nir_link_uniforms(struct gl_context *ctx, int location = var->data.location; struct gl_uniform_block *blocks; - int num_blocks; + int num_blocks = 0; int buffer_block_index = -1; if (!prog->data->spirv && state.var_is_in_block) { /* If the uniform is inside a uniform block determine its block index by -- 2.7.4