mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
glcpp: Initialize location structure at beginning of parse.
Since we have a custom structure for YYLTYPE locations, we need to use an %initial-action directive to avoid triggering use of uninitialized memory when, for example, printing error messages. We apparently don't yet have a test case that allowed valgrind to find this bug for us, but valgrind found a similar problem in the other parser, so we fix this one as well.
This commit is contained in:
parent
a7d6c496cf
commit
485f84d366
1 changed files with 8 additions and 0 deletions
|
|
@ -142,7 +142,15 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
|
|||
|
||||
%pure-parser
|
||||
%error-verbose
|
||||
|
||||
%locations
|
||||
%initial-action {
|
||||
@$.first_line = 1;
|
||||
@$.first_column = 1;
|
||||
@$.last_line = 1;
|
||||
@$.last_column = 1;
|
||||
@$.source = 0;
|
||||
}
|
||||
|
||||
%parse-param {glcpp_parser_t *parser}
|
||||
%lex-param {glcpp_parser_t *parser}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue