diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp index ac3b52d..fb50e27 100644 --- a/src/compiler/glsl/ast_function.cpp +++ b/src/compiler/glsl/ast_function.cpp @@ -2099,13 +2099,20 @@ ast_function_expression::hir(exec_list *instructions, process_parameters(instructions, &actual_parameters, &this->expressions, state); - if (id->oper == ast_array_index) { + switch (id->oper) { + case ast_array_index: array_idx = generate_array_index(ctx, instructions, state, loc, id->subexpressions[0], id->subexpressions[1], &func_name, &actual_parameters); - } else { + break; + case ast_int_constant: + _mesa_glsl_error(& loc, state, "%i is no valid function name", + id->primary_expression.identifier); + return ir_rvalue::error_value(ctx); + default: func_name = id->primary_expression.identifier; + break; } /* an error was emitted earlier */