st_glsl_to_nir: fix potential use after free
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 15 Jun 2020 23:35:09 +0000 (09:35 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 17 Jun 2020 01:35:38 +0000 (11:35 +1000)
commitb2e9d21fdd679fba80c358ed7871c30987d10e05
tree27f903912865e6fccce353bf88984a3c59f263b8
parent7e8e02d54324623cc7a34efe23e20f0a77a3d2f0
st_glsl_to_nir: fix potential use after free

When updating the shader info used by GL for the API we must
remember to make sure to restore the pointers to its own name
and label strings. There are a number of ways in which the nir
copy of these strings can be freed before GL is finished with
them.

Fixes: 36be8c2fcf94 ("st/glsl_to_nir: use nir_shader_gather_info()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2875
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5488>
src/mesa/state_tracker/st_glsl_to_nir.cpp