r600: don't use shader key without verifying shader type (v2)
authorDave Airlie <airlied@redhat.com>
Mon, 7 Sep 2015 22:36:32 +0000 (08:36 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Sep 2015 22:42:06 +0000 (08:42 +1000)
commit6d2ceb10cd63b89892131a27d238620f00922dfb
tree2671d422084bb891b8971d2fe802645bd40a6205
parentf5509874aa747167255c2fb739ed44be2445a4c6
r600: don't use shader key without verifying shader type (v2)

Since 7a32652231f96eac14c4bfce02afe77b4132fb77
r600: Turn 'r600_shader_key' struct into union

we were accessing key fields that might be aliased in the union
with other fields, so we should check what shader type we are
compiling for before using key values from it.

v1.1: make it compile
v2: have caffeine, make it work - we don't set type
until later, so don't reference it until we've set it.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c