summaryrefslogtreecommitdiffstats
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-04-14 16:16:20 -0700
committerEric Anholt <[email protected]>2010-04-14 16:18:19 -0700
commit1e7ec3ce128a9d30d7d9e1707a22b270eb525075 (patch)
treecd1128935a1b92cafdda815ece92c4723c42fbd0 /ast_to_hir.cpp
parent8558459512594216c5aed0bb8d2b0efcbc8b921c (diff)
Check that function definition parameter qualifiers match proto qualifiers.
Fixes function9.frag.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 4e1c8191771..b150ba36908 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1841,6 +1841,29 @@ ast_function::hir(exec_list *instructions,
* definition.
*/
if (parameter_lists_match(& hir_parameters, & sig->parameters)) {
+ exec_list_iterator iter_a = hir_parameters.iterator();
+ exec_list_iterator iter_b = sig->parameters.iterator();
+
+ /* check that the qualifiers match. */
+ while (iter_a.has_next()) {
+ ir_variable *a = (ir_variable *)iter_a.get();
+ ir_variable *b = (ir_variable *)iter_b.get();
+
+ if (a->read_only != b->read_only ||
+ a->interpolation != b->interpolation ||
+ a->centroid != b->centroid) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "function `%s' parameter `%s' qualifiers "
+ "don't match prototype",
+ name, a->name);
+ }
+
+ iter_a.next();
+ iter_b.next();
+ }
+
/* FINISHME: Compare return types. */
if (is_definition && (sig->definition != NULL)) {