diff options
author | Juergen Kahrs <Juergen.Kahrs@googlemail.com> | 2013-12-23 18:26:45 +0100 |
---|---|---|
committer | Juergen Kahrs <Juergen.Kahrs@googlemail.com> | 2013-12-23 18:26:45 +0100 |
commit | ee9707cc44eea3ca64cb71666ac3e8ed26a3bb7f (patch) | |
tree | 3945f1b3afd64a7147582611f21b7f5e59891e41 /array.c | |
parent | 0ac63db595a009d1f07dba8246e52710348b0798 (diff) | |
parent | c66f7da30bb5635957b6e68c1e1db7e77e7b4174 (diff) | |
download | egawk-ee9707cc44eea3ca64cb71666ac3e8ed26a3bb7f.tar.gz egawk-ee9707cc44eea3ca64cb71666ac3e8ed26a3bb7f.tar.bz2 egawk-ee9707cc44eea3ca64cb71666ac3e8ed26a3bb7f.zip |
Merge remote-tracking branch 'origin/master' into cmake
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -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 */ @@ -854,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); } |