mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-25 14:30:22 +01:00
glsl/glcpp: fix SIGSEGV when checking error condition for macro redefinition
Commita6e9cd14cdoes not take into account than node_{a,b}->next could be NULL in some circumstances, such as in a shader containing this code: #define A 1 /* comment */ #define A 1 /* comment */ This patch fixes the segmentation fault for cases like that. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91290 Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit30f97b5e52)
This commit is contained in:
parent
a31dfd91b5
commit
56e4cc67fe
1 changed files with 2 additions and 2 deletions
|
|
@ -1074,9 +1074,9 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
|
|||
*/
|
||||
if (node_a->token->type == SPACE
|
||||
&& node_b->token->type == SPACE) {
|
||||
while (node_a->token->type == SPACE)
|
||||
while (node_a && node_a->token->type == SPACE)
|
||||
node_a = node_a->next;
|
||||
while (node_b->token->type == SPACE)
|
||||
while (node_b && node_b->token->type == SPACE)
|
||||
node_b = node_b->next;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue