From 7297f931f04bedb2a49a723972e5de8daad7b487 Mon Sep 17 00:00:00 2001 From: Erico Nunes Date: Wed, 2 Feb 2022 12:30:56 +0100 Subject: [PATCH] lima/ppir: initialize slots array for dummy/undef Some functions in ppir iterate the ppir_op_info slots arrays looking for the PPIR_INSTR_SLOT_END token. The dummy/undef internal ops may appear in the scheduling code and their slots arrays did not contain that token, which could result in invalid array reads. Reported by gcc -fsanitize=address. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick Cc: 22.0 Part-of: --- src/gallium/drivers/lima/ir/pp/node.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/lima/ir/pp/node.c b/src/gallium/drivers/lima/ir/pp/node.c index 8948208b220..7465e4e8b44 100644 --- a/src/gallium/drivers/lima/ir/pp/node.c +++ b/src/gallium/drivers/lima/ir/pp/node.c @@ -333,12 +333,14 @@ const ppir_op_info ppir_op_infos[] = { .name = "undef", .type = ppir_node_type_alu, .slots = (int []) { + PPIR_INSTR_SLOT_END }, }, [ppir_op_dummy] = { .name = "dummy", .type = ppir_node_type_alu, .slots = (int []) { + PPIR_INSTR_SLOT_END }, }, };