mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
glsl2: 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. Thanks to valgrind for noticing this bug.
This commit is contained in:
parent
0ff3b2b344
commit
60d8c46995
1 changed files with 9 additions and 1 deletions
|
|
@ -35,9 +35,17 @@
|
|||
%}
|
||||
|
||||
%pure-parser
|
||||
%locations
|
||||
%error-verbose
|
||||
|
||||
%locations
|
||||
%initial-action {
|
||||
@$.first_line = 1;
|
||||
@$.first_column = 1;
|
||||
@$.last_line = 1;
|
||||
@$.last_column = 1;
|
||||
@$.source = 0;
|
||||
}
|
||||
|
||||
%lex-param {void *scanner}
|
||||
%parse-param {struct _mesa_glsl_parse_state *state}
|
||||
%name-prefix "_mesa_glsl_"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue