[Mesa-stable] [PATCH 2/2] glsl: return cloned signature, not the builtin one

Ilia Mirkin imirkin at alum.mit.edu
Sat Feb 6 23:10:16 CET 2016


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 <imirkin at alum.mit.edu>
Cc: mesa-stable at lists.freedesktop.org
---
 src/compiler/glsl/ast_function.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index 0eb456a..c7fdcb2 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;
-- 
2.4.10



More information about the mesa-stable mailing list