glsl2: Fixed cloning of ir_call error instructions.
authorTilman Sauerbeck <tilman@code-monkey.de>
Fri, 17 Sep 2010 23:56:34 +0000 (01:56 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 18 Sep 2010 07:19:57 +0000 (09:19 +0200)
Those have the callee field set to the null pointer, so
calling the public constructor will segfault.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
src/glsl/ir_clone.cpp

index aa84cf0572514ae7361d5a76e35d0a73563c505e..18543a35aa19c93a4bb52e8b1537ec9b8ec437f3 100644 (file)
@@ -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) {