[Mesa-dev] [PATCH] mesa/st: fix conditional jump depends on uninitialised value

Nicolai Hähnle nhaehnle at gmail.com
Mon Jul 31 12:58:44 UTC 2017


On 31.07.2017 14:48, Timothy Arceri wrote:
> Reported by valgrind at:
> glsl_to_tgsi_visitor::visit(ir_expression*) (st_glsl_to_tgsi.cpp:1560)
> 
> When compiling the Deus Ex shaders.
> 
> Cc: Karol Herbst <karolherbst at gmail.com>
> Cc: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
> 
>   There is probably more to this. I didn't look too hard.

Nah, I don't think so. Or at least there's no reason to think so. All it 
takes for this bug is for asm to be emitted before 
visit(ir_assignment*). Good catch!

Please add:

Fixes: 28a5e7104 ("st/glsl_to_tgsi: handle precise modifier")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

> 
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 0d0eceb312..f22ee18504 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4637,20 +4637,21 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor()
>      num_address_regs = 0;
>      samplers_used = 0;
>      images_used = 0;
>      indirect_addr_consts = false;
>      wpos_transform_const = -1;
>      glsl_version = 0;
>      native_integers = false;
>      mem_ctx = ralloc_context(NULL);
>      ctx = NULL;
>      prog = NULL;
> +   precise = 0;
>      shader_program = NULL;
>      shader = NULL;
>      options = NULL;
>      have_sqrt = false;
>      have_fma = false;
>      use_shared_memory = false;
>      has_tex_txf_lz = false;
>      variables = NULL;
>   }
>   
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list