etnaviv: fix null pointer dereference

Fixes: 734b15186b ("etnaviv: Stop passing around nir_dest")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24717>
This commit is contained in:
Christian Gmeiner 2023-08-16 09:57:18 +02:00 committed by Marge Bot
parent cff6c4d885
commit bd1d322107

View file

@ -181,7 +181,7 @@ update_swiz_mask(nir_alu_instr *alu, nir_def *def, unsigned *swiz, unsigned *mas
bool is_vec = def != NULL;
unsigned swizzle = 0, write_mask = 0;
for (unsigned i = 0; i < def->num_components; i++) {
for (unsigned i = 0; i < alu->def.num_components; i++) {
/* src is different (only check for vecN) */
if (is_vec && alu->src[i].src.ssa != def)
continue;