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 <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: 22.0 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
(cherry picked from commit 7297f931f0)
This commit is contained in:
Erico Nunes 2022-02-02 12:30:56 +01:00 committed by Dylan Baker
parent 1e7d39f9db
commit 295022cb75
2 changed files with 3 additions and 1 deletions

View file

@ -715,7 +715,7 @@
"description": "lima/ppir: initialize slots array for dummy/undef",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -330,12 +330,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
},
},
};