compiler/spirv: reject invalid shader code properly
authorMartin Pelikán <mpel@google.com>
Fri, 1 Jun 2018 12:27:24 +0000 (14:27 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 1 Jun 2018 15:09:35 +0000 (08:09 -0700)
commit53719f818cf320add55dc7ed3612725c2f6128ce
tree527021754c711aaa7618d58201969fc75e78a90f
parent360bfb619f394849213b24f3a62696db3210d1ed
compiler/spirv: reject invalid shader code properly

After bebe3d626e5, b->fail_jump is prepared after vtn_create_builder
which can longjmp(3) to it through its vtx_assert()s.  This corrupts
the stack and creates confusing core dumps, so we need to avoid it.

While there, I decided to print the offending values for debugability.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_private.h