diff options
author | Francisco Jerez <[email protected]> | 2013-09-20 15:36:38 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-10-01 17:30:51 -0700 |
commit | 8bd1c69f3bc731a53d785aa7b3e8fea05bacef7d (patch) | |
tree | 313a298efb8b34f92169efa1774f43f185d4171d /src/glsl/glsl_parser_extras.cpp | |
parent | 70953b5fea1445fe121ac4b4a816c984742f2e19 (diff) |
glsl: Switch ast_node to the non-zeroing allocator.
All member variables of ast_node are already being initialized from
its constructor, but some of its derived classes were leaving members
uninitialized -- Fix them.
Using rzalloc makes it more likely that we will start relying on the
allocator to zero out all memory if the class is ever extended with
new member variables. That's bad 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.
v2: Use NULL initialization instead of default construction for pointers.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r-- | src/glsl/glsl_parser_extras.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 3bc8d482775..4f2f2893a90 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -1050,7 +1050,8 @@ ast_expression::print(void) const ast_expression::ast_expression(int oper, ast_expression *ex0, ast_expression *ex1, - ast_expression *ex2) + ast_expression *ex2) : + primary_expression() { this->oper = ast_operators(oper); this->subexpressions[0] = ex0; |