From c9a5f586b71f564d66e9702b1d6e30b67dabddda Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Wed, 12 Mar 2025 19:08:16 -0500 Subject: [PATCH] vkd3d-shader/hlsl: Zero-initialize "nonconst_i" and "ret_swizzle" in copy_propagation_replace_with_deref(). GCC without LTO is unable to determine that these are never used uninitialized. --- libs/vkd3d-shader/hlsl_codegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index e95eaa39..a8ff7cbd 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1898,19 +1898,19 @@ static bool copy_propagation_replace_with_deref(struct hlsl_ctx *ctx, uint32_t swizzle, struct hlsl_ir_node *instr) { const unsigned int instr_component_count = hlsl_type_component_count(instr->data_type); + unsigned int nonconst_i = 0, base, scale, count; struct hlsl_ir_node *index, *new_instr = NULL; const struct hlsl_deref *deref = &load->src; - unsigned int nonconst_i, base, scale, count; const struct hlsl_ir_var *var = deref->var; unsigned int time = load->node.index; struct hlsl_deref tmp_deref = {0}; struct hlsl_ir_load *new_load; struct hlsl_ir_var *x = NULL; int *c = NULL, *d = NULL; + uint32_t ret_swizzle = 0; struct hlsl_block block; unsigned int path_len; bool success = false; - uint32_t ret_swizzle; int i, j, k; if (!nonconst_index_from_deref(ctx, deref, &nonconst_i, &base, &scale, &count))