glsl: Fix yylloc.source propagation in YYLLOC_DEFAULT
authorSviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Mon, 3 Jul 2023 06:45:29 +0000 (09:45 +0300)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Jul 2023 20:22:27 +0000 (20:22 +0000)
commit791785c2b4c01abf1a0207fb4697789ff03af218
treebc040c268c03e678a14820de7b49888303446b07
parent80ccc3f822d32f014ccb7ab7283a1a80e6f7d9ca
glsl: Fix yylloc.source propagation in YYLLOC_DEFAULT

Currently, it's always initialized to 0, but we should take the value from
the grouping passed to the macro. This way parser will have the full
location info, and errors originating from it will show the correct
source file number.

Fixes: a0cfe8c4 ("glsl: Fix missing initialization of yylloc.source")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9229
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23966>
src/compiler/glsl/glcpp/glcpp.h
src/compiler/glsl/glsl_parser_extras.h