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 <[email protected]>
Cc: [email protected]
---
 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

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to