[Mesa-dev] [PATCH] mesa: ensure that variable is initialized

Mark Janes mark.a.janes at intel.com
Tue Apr 3 00:23:54 UTC 2018


Tested-by: Mark Janes <mark.a.janes at intel.com>

Dylan Baker <dylan at pnwbakers.com> writes:

> locally I've added:
> Fixes: 16f6634e7fb5ada308e55b852cd49251e7f3f8b1 
>        ("mesa/program: Link SPIR-V shaders using the SPIR-V code-path")
>
> Quoting Dylan Baker (2018-04-02 15:36:01)
>> Otherwise this variable will only be set if there are spirv shaders
>> present, but it's used regardless, resulting in undefined behavior.
>> 
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105820
>> CC: Alejandro PiƱeiro <apinheiro at igalia.com>
>> CC: Mark Janes <mark.a.janes at intel.com>
>> Signed-off-by: Dylan Baker <dylan.c.baker at intel.com>
>> ---
>>  src/mesa/program/ir_to_mesa.cpp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
>> index 49ef5ea52d8..60fb24bf664 100644
>> --- a/src/mesa/program/ir_to_mesa.cpp
>> +++ b/src/mesa/program/ir_to_mesa.cpp
>> @@ -3126,7 +3126,7 @@ void
>>  _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
>>  {
>>     unsigned int i;
>> -   bool spirv;
>> +   bool spirv = false;
>>  
>>     _mesa_clear_shader_program_data(ctx, prog);
>>  
>> -- 
>> 2.16.3
>> 


More information about the mesa-dev mailing list