diff options
author | Eric Anholt <eric@anholt.net> | 2010-04-14 16:19:19 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-04-14 16:19:19 -0700 |
commit | 60be7626b829af7e1d07330b9a88468924ba350e (patch) | |
tree | 7ff06a0dfd483e4d821c5f5e2ab8812d94d0ab8c /ast_to_hir.cpp | |
parent | 1e7ec3ce128a9d30d7d9e1707a22b270eb525075 (diff) |
Check that the return type of function definition matches its prototype.
Doesn't fix any testcases, but fixes a FINISHME.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r-- | ast_to_hir.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index b150ba3690..251845acd9 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -1864,7 +1864,14 @@ ast_function::hir(exec_list *instructions, iter_b.next(); } - /* FINISHME: Compare return types. */ + if (sig->return_type != return_type) { + YYLTYPE loc = this->get_location(); + + _mesa_glsl_error(& loc, state, + "function `%s' return type doesn't match " + "prototype", + name); + } if (is_definition && (sig->definition != NULL)) { YYLTYPE loc = this->get_location(); |