diff options
author | Dave Airlie <[email protected]> | 2016-05-03 14:39:06 +1000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-06-14 15:48:37 +0100 |
commit | 09f48203c540f6eacf4580b168b575c77478272f (patch) | |
tree | 485add7462d02c9425be0df66dcffa9140cabf23 | |
parent | 997bcc45ecdc5046e60b43975b4fc22a55dbe46b (diff) |
glsl/ast: don't crash when func_name is NULL
This fixes a crash in
GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types
If we can't find the func_name in one of these paths,
we have emitted an earlier error so just return here.
Reviewed-by: Timothy Arceri <[email protected]>
Cc: "11.2 12.0" <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
(cherry picked from commit 6702c1581092bce230742d02ebf9325f68bd247a)
-rw-r--r-- | src/compiler/glsl/ast_function.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp index a97e6c96114..f74394fe1d3 100644 --- a/src/compiler/glsl/ast_function.cpp +++ b/src/compiler/glsl/ast_function.cpp @@ -2078,6 +2078,10 @@ ast_function_expression::hir(exec_list *instructions, func_name = id->primary_expression.identifier; } + /* an error was emitted earlier */ + if (!func_name) + return ir_rvalue::error_value(ctx); + ir_function_signature *sig = match_function_by_name(func_name, &actual_parameters, state); |