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: 0346ad3774 ("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>
This commit is contained in:
committed by
Marge Bot
parent
0c37cbf807
commit
2c711beb5c
@@ -1187,6 +1187,9 @@ _token_list_equal_ignoring_space(token_list_t *a, token_list_t *b)
|
||||
node_b = node_b->next;
|
||||
}
|
||||
|
||||
if (node_a == NULL && node_b == NULL)
|
||||
break;
|
||||
|
||||
if (node_b == NULL && node_a->token->type == SPACE) {
|
||||
while (node_a && node_a->token->type == SPACE)
|
||||
node_a = node_a->next;
|
||||
|
||||
Reference in New Issue
Block a user