glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 12 Sep 2013 03:07:53 +0000 (20:07 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 2 Oct 2013 00:30:51 +0000 (17:30 -0700)
commit43bf36b080192f7ad5727ed96e86f0a49390d9dc
treee0edb9f48c2c437f1343864c9349b25d4d4012d1
parent0e72db9f9729b8fe62213452751fed1cd337a7bc
glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.

The _mesa_glsl_parse_state object relies on the memory allocator
zeroing out its contents before it's initialized, which is quite an
unusual practice in the C++ world because it ties objects to some
specific allocation scheme, and gives unpredictable results when an
object is created with a different allocator -- Stack allocation,
array allocation, or aggregation inside a different object are some of
the useful possibilities that come to my mind.  Initialize all fields
from the constructor and stop using the zeroing allocator.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h