nir: Use VARYING_SLOT_TESS_MAX to size indirect bitmasks
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 25 Oct 2019 18:18:52 +0000 (11:18 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 25 Oct 2019 20:29:09 +0000 (13:29 -0700)
commitf306d079320b328199898b15601ac5633b5781bd
tree3ad4a6e8f3d7c5c3cd4347f0ece953f789ab140b
parente919c44c3bc9f4aa9ff2e736948be52b03796162
nir: Use VARYING_SLOT_TESS_MAX to size indirect bitmasks

MAX_VARYINGS_INCL_PATCH subtracts VARYING_SLOT_VAR0 giving us a size
that's too small, so BITSET_SET writes words out of bounds, corrupting
the stack and causing all kinds of chaos.  VARYING_SLOT_TESS_MAX is
the right value to use here, as it's the largest location.

Closes: 2002
Fixes: ee2050b1111 ("nir: Use BITSET for tracking varyings in lower_io_arrays")
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/compiler/nir/nir_lower_io_arrays_to_elements.c