From 494e4b8976a48e37e3cb51338ad69e085ea5061a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 13 May 2016 01:56:44 -0500 Subject: [PATCH] st_glsl_to_tgsi: don't read potentially uninitialized buffer variable Found by -fsanitize=undefined. Note that this should be a harmless issue in practice because the inst->op check always dominates anyway. Reviewed-by: Brian Paul Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index b7eaa13ffb2..8c6fe79d832 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3334,7 +3334,7 @@ glsl_to_tgsi_visitor::visit_ssbo_intrinsic(ir_call *ir) inst = (glsl_to_tgsi_instruction *)inst->get_prev(); if (inst->op == TGSI_OPCODE_UADD) inst = (glsl_to_tgsi_instruction *)inst->get_prev(); - } while (inst && inst->buffer.file == PROGRAM_UNDEFINED && inst->op == op); + } while (inst && inst->op == op && inst->buffer.file == PROGRAM_UNDEFINED); } void -- 2.30.2