i965/vec4: Only examine virtual_grf_end for GRF sources
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 11 Sep 2014 00:57:54 +0000 (17:57 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 11 Sep 2014 18:18:36 +0000 (11:18 -0700)
commit7aeb853c90c2e84fdd4b6b0af97566562c912861
tree8916d3b7482da224a96b0576704ccacaa88612ff
parenta46d7579e9b92a48e391ef63be7129a957bf155a
i965/vec4: Only examine virtual_grf_end for GRF sources

If the source is not a GRF, it could have a register >= virtual_grf_count.
Accessing virtual_grf_end with such a register would lead to
out-of-bounds access.  Make sure the source is a GRF before accessing
virtual_grf_end.

Fixes Valgrind complaints while compiling some shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
src/mesa/drivers/dri/i965/brw_vec4_cse.cpp