[Mesa-dev] [PATCH] Fix line number on no matching function call

Ian Romanick idr at freedesktop.org
Fri Dec 6 08:27:08 PST 2013


On 12/06/2013 12:34 AM, Kevin Rogovin wrote:
> This (very tiny) patch fixes the bug (#72264) where when 
> no matching function call was found the error message
> gave the line and column number as 0.

The commit message should describe why the change was made.  This just
reiterates the problem.  The commit messages are one of our best sources
of documentation of the code (in conjunction with git-blame), so it's
important for them to be useful.

>From this code and commit message, I have no clue why this fixes the
problem, and I have no evidence that this is the correct fix.  From the
bug, I would have expected the fix to be ensuring that id had the proper
location set.  Why is this a better fix than that?

Also, the usual way to refer to a bug in a commit message is:

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72264

Try looking that git-log to see numerous examples.

> ---
>  src/glsl/ast_function.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
> index 6423759..9dc5427 100644
> --- a/src/glsl/ast_function.cpp
> +++ b/src/glsl/ast_function.cpp
> @@ -1656,7 +1656,7 @@ ast_function_expression::hir(exec_list *instructions,
>     } else {
>        const ast_expression *id = subexpressions[0];
>        const char *func_name = id->primary_expression.identifier;
> -      YYLTYPE loc = id->get_location();
> +      YYLTYPE loc = get_location();
>        exec_list actual_parameters;
>  
>        process_parameters(instructions, &actual_parameters, &this->expressions,
> 



More information about the mesa-dev mailing list