summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-05-17 14:52:38 +1000
committerDave Airlie <[email protected]>2016-05-23 16:19:56 +1000
commit432ac19c1ad34f32bdcfe6ec7823383ee24eb016 (patch)
tree2eb421f01fc45530d5539c7026f0dbfe90dfcbcd /src/compiler
parent18b0a13e803d740e52f1205b690e30cd119bcf87 (diff)
glsl/linker: link error on too many subroutine functions.
This fixes: GL45-CTS.explicit_uniform_location.subroutine-index-negative-link-max-num-of-indices Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/linker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index ef8db563bb2..4c567fca549 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4229,6 +4229,10 @@ link_assign_subroutine_types(struct gl_shader_program *prog)
if (!fn->num_subroutine_types)
continue;
+ if (sh->NumSubroutineFunctions + 1 > MAX_SUBROUTINES) {
+ linker_error(prog, "Too many subroutine functions declared.\n");
+ return;
+ }
sh->SubroutineFunctions = reralloc(sh, sh->SubroutineFunctions,
struct gl_subroutine_function,
sh->NumSubroutineFunctions + 1);