From: Ilia Mirkin Date: Sat, 6 Feb 2016 22:08:29 +0000 (-0500) Subject: glsl: return cloned signature, not the builtin one X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88519c60873e6a5d67fc1fc09b125e4fe2fa3aee;p=mesa.git glsl: return cloned signature, not the builtin one The builtin data can get released with a glReleaseShaderCompiler call. We're careful everywhere to clone everything that comes out of builtins except here, where we accidentally return the signature belonging to the builtin version, rather than the locally-cloned one. Signed-off-by: Ilia Mirkin Reviewed-by: Timothy Arceri Tested-by: Rob Herring Cc: mesa-stable@lists.freedesktop.org --- diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp index 0eb456a2b1f..c7fdcb24379 100644 --- a/src/compiler/glsl/ast_function.cpp +++ b/src/compiler/glsl/ast_function.cpp @@ -560,7 +560,8 @@ done: state->symbols->add_global_function(f); emit_function(state, f); } - f->add_signature(sig->clone_prototype(f, NULL)); + sig = sig->clone_prototype(f, NULL); + f->add_signature(sig); } } return sig;