[Mesa-dev] [PATCH 2/3] st_glsl_to_tgsi: don't read potentially uninitialized buffer variable

Ilia Mirkin imirkin at alum.mit.edu
Tue Jun 14 14:40:54 UTC 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Tue, Jun 14, 2016 at 10:37 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Found by -fsanitize=undefined. Note that this should be a harmless issue in
> practice because the inst->op check always dominates anyway.
> ---
>  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 b7eaa13..8c6fe79 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.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list