nir: fix potential left shift of a negative value
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 5 Aug 2020 20:03:31 +0000 (21:03 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 10:52:19 +0000 (10:52 +0000)
commit27ec38d746824046f780efa934d4f25c1c8b32a8
tree13517ce6baa69664da52b8161a32b6d5fd802750
parent391eeb744356353e96ce34f23b8b16b718a02d61
nir: fix potential left shift of a negative value

Fixes UBSan error:
src/compiler/nir/nir_constant_expressions.c:36573:32: runtime error: left shift of negative value -1

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
src/compiler/nir/nir_opcodes.py