From: Eric Anholt Date: Wed, 14 Apr 2010 23:19:19 +0000 (-0700) Subject: Check that the return type of function definition matches its prototype. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60be7626b829af7e1d07330b9a88468924ba350e;p=mesa.git Check that the return type of function definition matches its prototype. Doesn't fix any testcases, but fixes a FINISHME. --- 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();