From 60be7626b829af7e1d07330b9a88468924ba350e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Apr 2010 16:19:19 -0700 Subject: [PATCH] Check that the return type of function definition matches its prototype. Doesn't fix any testcases, but fixes a FINISHME. --- ast_to_hir.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index b150ba36908..251845acd9d 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(); -- 2.30.2