summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_reader.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-09-05 12:03:29 -0700
committerKenneth Graunke <[email protected]>2011-09-07 07:49:32 -0700
commit8ceb235c9cbb9504e32479db54287ed9387df75a (patch)
treeede163deb63bf9e26a347276dcc3e194b4e9cc2a /src/glsl/ir_reader.cpp
parent6afce988a9ee41af4ac1244d488ae6b89edf8d13 (diff)
glsl/ir_reader: Make sure constants have the right number of components.
The list of numbers in (constant type (<numbers>)) needs to contain exactly type->components() numbers (16 for a mat4, 3 for a vec3, etc.) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir_reader.cpp')
-rw-r--r--src/glsl/ir_reader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index 22009eebcb9..10bf72aeeb8 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -820,6 +820,11 @@ ir_reader::read_constant(s_expression *expr)
}
++k;
}
+ if (k != type->components()) {
+ ir_read_error(values, "expected %d constant values, found %d",
+ type->components(), k);
+ return NULL;
+ }
return new(mem_ctx) ir_constant(type, &data);
}