On Wed, Mar 1, 2017 at 5:59 PM, Emil Velikov <[email protected]> wrote:
> On 22 February 2017 at 19:04, Nicolai Hähnle <[email protected]> wrote:
>> From: Nicolai Hähnle <[email protected]>
>>
>> exec_node::get_prev() does not guard against going past the beginning
>> of the list, so we need to add explicit checks here.
>>
>> Found by ASAN in piglit arb_shader_storage_buffer_object-rendering.
>>
>> Cc: [email protected]
>> ---
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
>> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> index 630f5af..fac41b8 100644
>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> @@ -3603,24 +3603,31 @@ glsl_to_tgsi_visitor::visit_ssbo_intrinsic(ir_call 
>> *ir)
>>     }
>>
>>     /* The emit_asm() might have actually split the op into pieces, e.g. for
>>      * double stores. We have to go back and fix up all the generated ops.
>>      */
>>     unsigned op = inst->op;
>>     do {
>>        inst->resource = buffer;
>>        if (access)
>>           inst->buffer_access = access->value.u[0];
>> +
>> +      if (inst == this->instructions.get_head_raw())
>> +         break;
>>        inst = (glsl_to_tgsi_instruction *)inst->get_prev();
>> -      if (inst->op == TGSI_OPCODE_UADD)
>> +
>> +      if (inst->op == TGSI_OPCODE_UADD) {
>> +         if (inst == this->instructions.get_head_raw())
>> +            break;
>>           inst = (glsl_to_tgsi_instruction *)inst->get_prev();
>> -   } while (inst && inst->op == op && inst->resource.file == 
>> PROGRAM_UNDEFINED);
>> +      }
>> +   } while (inst->op == op && inst->resource.file == PROGRAM_UNDEFINED);
>>  }
>>
>
> Afaict the patch/equivalent has not landed in master. Short on review
> or simply superseded ?

It applies cleanly, so I'll test piglit and push if there are no regressions.

Marek
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to