nir/unsigned_upper_bound: fix buffer overflow in search_phi_bcsel
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 24 Nov 2020 10:52:56 +0000 (10:52 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Wed, 25 Nov 2020 11:26:42 +0000 (11:26 +0000)
commit65fbae16e37b5f349a0d0feb8d54ba132a1f02f4
treec286fbc65c9a3deef395ea2f6940dbebde631c95
parentcf0b54cdc16c9e7197954259e87ae194d65fb0ec
nir/unsigned_upper_bound: fix buffer overflow in search_phi_bcsel

It should only recurse if there's enough space to add the phi sources.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 72ac3f60261 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7748>
src/compiler/nir/nir_range_analysis.c