lima/gpir: avoid invalid write in regalloc
authorErico Nunes <nunes.erico@gmail.com>
Wed, 2 Feb 2022 11:27:08 +0000 (12:27 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Feb 2022 21:55:10 +0000 (21:55 +0000)
commit5b1584936632f9e7f21cc57746ca51cbdc526b0f
tree7c5053aa1432e05e420d507c293ad9e9360964b6
parent58c619c3d6dfb6bd70a3ff7b4c9ece970bc2a2ee
lima/gpir: avoid invalid write in regalloc

Reported by gcc -fsanitize=address, sometimes gpir regalloc attempts to
handle an uninitialized node->value_reg (containing the value -1), which
results in an invalid array access.
Avoid it for now to prevent crashes, but more investigation may be
required later on.

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>
src/gallium/drivers/lima/ir/gp/regalloc.c