mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 15:50:17 +01:00
glcpp: Fix undefined behaviour in glcpp
Specifically, fix this error (which is covered in existing tests):
../src/compiler/glsl/glcpp/pp.c:198:28: runtime error: applying non-zero offset 1 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/compiler/glsl/glcpp/pp.c:198:28 in
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9669>
This commit is contained in:
parent
95c58aacf8
commit
02492bea5f
1 changed files with 2 additions and 2 deletions
|
|
@ -195,11 +195,11 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
|
|||
}
|
||||
}
|
||||
|
||||
search_start = backslash + 1;
|
||||
|
||||
if (backslash == NULL)
|
||||
break;
|
||||
|
||||
search_start = backslash + 1;
|
||||
|
||||
/* At each line continuation, (backslash followed by a
|
||||
* newline), copy all preceding text to the output, then
|
||||
* advance the shader pointer to the character after the
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue