mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
st/glsl_to_tgsi: avoid iterating past the head of the instruction list
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: mesa-stable@lists.freedesktop.org
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 911391bd70)
This commit is contained in:
parent
ea7711fc0f
commit
e59e2c664f
1 changed files with 9 additions and 2 deletions
|
|
@ -3432,10 +3432,17 @@ glsl_to_tgsi_visitor::visit_ssbo_intrinsic(ir_call *ir)
|
|||
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);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue