aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r--mesalib/src/glsl/ir_reader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesalib/src/glsl/ir_reader.cpp b/mesalib/src/glsl/ir_reader.cpp
index 22009eebc..2d0bccb78 100644
--- a/mesalib/src/glsl/ir_reader.cpp
+++ b/mesalib/src/glsl/ir_reader.cpp
@@ -777,7 +777,7 @@ ir_reader::read_constant(s_expression *expr)
ir_constant_data data = { { 0 } };
// Read in list of values (at most 16).
- int k = 0;
+ unsigned k = 0;
foreach_iter(exec_list_iterator, it, values->subexpressions) {
if (k >= 16) {
ir_read_error(values, "expected at most 16 numbers");
@@ -820,6 +820,11 @@ ir_reader::read_constant(s_expression *expr)
}
++k;
}
+ if (k != type->components()) {
+ ir_read_error(values, "expected %u constant values, found %u",
+ type->components(), k);
+ return NULL;
+ }
return new(mem_ctx) ir_constant(type, &data);
}