[Mesa-dev] [PATCH] glsl: Initialize ast_parameter_declarator member variables.
Brian Paul
brianp at vmware.com
Mon Feb 4 07:12:24 PST 2013
On 02/02/2013 12:41 AM, Vinson Lee wrote:
> Fixes uninitialized pointer field defect reported by Coverity.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> src/glsl/ast.h | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/glsl/ast.h b/src/glsl/ast.h
> index 1a28963..fcc6b45 100644
> --- a/src/glsl/ast.h
> +++ b/src/glsl/ast.h
> @@ -547,11 +547,15 @@ public:
>
> class ast_parameter_declarator : public ast_node {
> public:
> - ast_parameter_declarator()
> + ast_parameter_declarator() :
> + type(NULL),
> + identifier(NULL),
> + is_array(false),
> + array_size(NULL),
> + formal_parameter(false),
> + is_void(false)
> {
> - this->identifier = NULL;
> - this->is_array = false;
> - this->array_size = 0;
> + /* empty */
> }
>
> virtual void print(void) const;
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list