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:

committed by
Marge Bot

parent
95c58aacf8
commit
02492bea5f
@@ -195,11 +195,11 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
search_start = backslash + 1;
|
|
||||||
|
|
||||||
if (backslash == NULL)
|
if (backslash == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
search_start = backslash + 1;
|
||||||
|
|
||||||
/* At each line continuation, (backslash followed by a
|
/* At each line continuation, (backslash followed by a
|
||||||
* newline), copy all preceding text to the output, then
|
* newline), copy all preceding text to the output, then
|
||||||
* advance the shader pointer to the character after the
|
* advance the shader pointer to the character after the
|
||||||
|
Reference in New Issue
Block a user