summaryrefslogtreecommitdiff
path: root/src/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-09-01 19:44:25 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-09-01 20:39:09 -0700
commitcfe0dd5622a9b26e6df18801413ad8dc336f0c56 (patch)
tree60c592e8f5635966059f1fb0fc5d50d4891b6749 /src/glsl
parente466b182bbf21f62fe6542091f4af3275555db80 (diff)
glsl: Reject structure constructors that have too many arguments.
Fixes piglit test constructor-27.vert.
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_function.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 1cd300c382..c3b4441435 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -1207,6 +1207,12 @@ ast_function_expression::hir(exec_list *instructions,
node = node->next;
}
+ if (!node->is_tail_sentinel()) {
+ _mesa_glsl_error(&loc, state, "too many parameters in constructor "
+ "for `%s'", type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
ir_rvalue *const constant =
constant_record_constructor(type, &actual_parameters, state);