[Mesa-dev] [PATCH] glsl2: Fixed cloning of ir_call error instructions.

Ian Romanick idr at freedesktop.org
Sat Sep 18 02:18:50 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tilman Sauerbeck wrote:
> Those have the callee field set to the null pointer, so
> calling the public constructor will segfault.

Do you have a test that triggers this?  It would be good to have it in
piglt.

> Signed-off-by: Tilman Sauerbeck <tilman at code-monkey.de>
> ---
>  src/glsl/ir_clone.cpp |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
> index aa84cf0..18543a3 100644
> --- a/src/glsl/ir_clone.cpp
> +++ b/src/glsl/ir_clone.cpp
> @@ -141,6 +141,9 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
>  ir_call *
>  ir_call::clone(void *mem_ctx, struct hash_table *ht) const
>  {
> +   if (this->type == glsl_type::error_type)
> +      return ir_call::get_error_instruction(mem_ctx);
> +
>     exec_list new_parameters;
>  
>     foreach_iter(exec_list_iterator, iter, this->actual_parameters) {

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyUg/YACgkQX1gOwKyEAw8zdACbBnANfgHkHL6kvUrIfcrR47At
NzMAn09m1w7iPvlQO298tgOA7P+c31c9
=sBiZ
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list