glsl/linker: fix output variable overlap check
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 17 Sep 2017 16:25:39 +0000 (18:25 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 20 Sep 2017 13:35:57 +0000 (15:35 +0200)
commit15cae12804ef288c7fb4cb9a38f7e32e6d8c4dc1
treea16cb7a6c9e2aae62af08521e64143752e3941a7
parent62a8ca22cde9907726f63d6a1915390fb2f21cfe
glsl/linker: fix output variable overlap check

Prevent an overflow caused by too many output variables. To limit the
scope of the issue, write to the assigned array only for the non-ES
fragment shader path, which is the only place where it's needed.

Since the function will bail with an error when output variables with
overlapping components are found, (max # of FS outputs) * 4 is an upper
limit to the space we need.

Found by address sanitizer.

Fixes dEQP-GLES3.functional.attribute_location.bind_aliasing.*

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/linker.cpp