From 933d15a9646fd550ad923005667d7014ef1cff97 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 19 Aug 2013 20:56:57 +0300 Subject: Fix in array.c. --- array.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 92a1cb8e..a0ddf580 100644 --- a/array.c +++ b/array.c @@ -113,21 +113,14 @@ null_array(NODE *symbol) symbol->table_size = symbol->array_size = 0; symbol->array_capacity = 0; symbol->flags = 0; - /* - * 5/2013: This used to be - * - * assert(symbol->xarray == NULL); - * - * But that seems to cause problems for no good reason - * that I can see. I believe it to be an artifact of the - * union getting in the way. - */ - symbol->xarray = NULL; + + assert(symbol->xarray == NULL); + /* vname, parent_array not (re)initialized */ } -/* null_lookup: assign type to an empty array. */ +/* null_lookup --- assign type to an empty array. */ static NODE ** null_lookup(NODE *symbol, NODE *subs) @@ -349,6 +342,7 @@ force_array(NODE *symbol, bool canfatal) switch (symbol->type) { case Node_var_new: + symbol->xarray = NULL; /* make sure union is as it should be */ null_array(symbol); symbol->parent_array = NULL; /* main array has no parent */ /* fall through */ -- cgit v1.2.3 From c3e4d0cf3f1fd24164e0a58db23b86b56c6dc7c8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Sep 2013 12:46:20 +0200 Subject: Fixes based on problems from a static checker. --- array.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'array.c') diff --git a/array.c b/array.c index a0ddf580..37894da5 100644 --- a/array.c +++ b/array.c @@ -848,6 +848,8 @@ asort_actual(int nargs, sort_context_t ctxt) /* source array is empty */ if (dest != NULL && dest != array) assoc_clear(dest); + if (list != NULL) + efree(list); return make_number((AWKNUM) 0); } -- cgit v1.2.3