diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2013-08-19 20:56:57 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2013-08-19 20:56:57 +0300 |
commit | 933d15a9646fd550ad923005667d7014ef1cff97 (patch) | |
tree | aa67ba7e961bb32315640485b924e3664e53f004 | |
parent | a68280e1d6610fd2213df92a8bb5c67bd4ef0668 (diff) | |
download | egawk-933d15a9646fd550ad923005667d7014ef1cff97.tar.gz egawk-933d15a9646fd550ad923005667d7014ef1cff97.tar.bz2 egawk-933d15a9646fd550ad923005667d7014ef1cff97.zip |
Fix in array.c.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | array.c | 16 |
2 files changed, 11 insertions, 11 deletions
@@ -1,3 +1,9 @@ +2013-08-18 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (force_array): Set symbol->xarray to NULL before + initing the array if it was Node_var_new. + (null_array): Restore assert, undoing change of 2013-05-27. + 2013-08-15 Arnold D. Robbins <arnold@skeeve.com> * debug.c (print_memory): Fix whitespace / indentation. @@ -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 */ |