glsl: do not crash if string literal is used outside of #include/#line
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Wed, 11 Mar 2020 13:29:12 +0000 (15:29 +0200)
committerDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Fri, 13 Mar 2020 09:49:06 +0000 (11:49 +0200)
Fixes: 67b32190f3c953c5b7091d76ddeff95c0cbfb439
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2619
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4146>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4146>

src/compiler/glsl/glcpp/glcpp-parse.y

index 1e57cccc4d1218fa0ab99e0db67a1c20ca241fb0..2a8ea817a98a7cc703f0923082428e65e247b02d 100644 (file)
@@ -1248,6 +1248,7 @@ _token_print(struct _mesa_string_buffer *out, token_t *token)
       break;
    case IDENTIFIER:
    case INTEGER_STRING:
+   case PATH:
    case OTHER:
       _mesa_string_buffer_append(out, token->value.str);
       break;