glcpp: Fully initialize struct gl_context
authorMichel Dänzer <mdaenzer@redhat.com>
Fri, 5 Mar 2021 22:48:00 +0000 (23:48 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Mar 2021 08:50:37 +0000 (08:50 +0000)
commit37855fd59d18f0f00b47554d08f546cdecafad68
treedc761ddcf822e6024758c9172dc562e0f8f78c82
parent1eb3a2d8da9b9f3fa4dd4ac9c9f4e7237a56d9ad
glcpp: Fully initialize struct gl_context

valgrind flagged members of gl_ctx->Extensions being used uninitialized:

==23417== Conditional jump or move depends on uninitialised value(s)
==23417==    at 0x112642: _glcpp_parser_handle_version_declaration.part.0 (glcpp-parse.y:2493)
==23417==    by 0x11A515: glcpp_lex_update_state_per_token (glcpp-lex.l:132)
==23417==    by 0x11A515: glcpp_lex (glcpp-lex.l:547)
==23417==    by 0x114D46: glcpp_parser_lex (glcpp-parse.y:2302)
==23417==    by 0x114D46: glcpp_parser_parse (glcpp-parse.c:1871)
==23417==    by 0x11ADC6: glcpp_preprocess (pp.c:238)
==23417==    by 0x111384: main (glcpp.c:174)
==23417==  Uninitialised value was created by a stack allocation
==23417==    at 0x111295: main (glcpp.c:136)

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
src/compiler/glsl/glcpp/glcpp.c