glsl: fix crash on glsl macro redefinition
authorAndrii Simiklit <asimiklit.work@gmail.com>
Wed, 3 Jun 2020 15:59:02 +0000 (18:59 +0300)
committerMarge Bot <eric+marge@anholt.net>
Wed, 10 Jun 2020 03:29:39 +0000 (03:29 +0000)
commit2c711beb5ce9fe013d557be71eb986444415b758
tree0e8218fbcdf7c7d46e9f9dd31dc0b16f75530a73
parent0c37cbf807f06b6aae1f17c99d653274110bad5d
glsl: fix crash on glsl macro redefinition

In case shader contains two equal macro defines, first one with trailing spaces
and the second one without.
`#define A 1   `
`#define A 1`
The parser crashes

Fixes: 0346ad37741b11d640c1c4970b275c1f0c7f9e75 ("glsl: ignore trailing whitespace when define redefined")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5312>
src/compiler/glsl/glcpp/glcpp-parse.y