From: Dave Airlie <[email protected]>

This fixes a crash in
GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types

Signed-off-by: Dave Airlie <[email protected]>
---
 src/compiler/glsl/ast_function.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_function.cpp 
b/src/compiler/glsl/ast_function.cpp
index 6c12565..ee7fda2 100644
--- a/src/compiler/glsl/ast_function.cpp
+++ b/src/compiler/glsl/ast_function.cpp
@@ -2041,7 +2041,10 @@ ast_function_expression::hir(exec_list *instructions,
       process_parameters(instructions, &actual_parameters, &this->expressions,
                         state);
 
-      if (id->oper == ast_array_index) {
+      if (id->oper == ast_function_call) {
+         _mesa_glsl_error(& loc, state, "function call cannot be used as a 
constructor\n");
+        return ir_rvalue::error_value(ctx);
+      } else if (id->oper == ast_array_index) {
          array_idx = generate_array_index(ctx, instructions, state, loc,
                                           id->subexpressions[0],
                                           id->subexpressions[1], &func_name,
-- 
2.5.5

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

Reply via email to