diff options
author | Andrew Ruder <aeruder@ksu.edu> | 2004-01-10 05:47:42 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@physics.uc.edu> | 2004-01-10 05:47:42 +0000 |
commit | bab1c40bb53f59c326370838fd16a49090c8150c (patch) | |
tree | 419424213290780261e61d34372cbb43fd5f3c70 /libobjc | |
parent | fd1cdf70450d42b6074fdf1825b91552a906eb8a (diff) |
2004-01-09 Andrew Ruder <aeruder@ksu.edu>
PR libobjc/11904
* sarray.c (sarray_free): Free array->is_copy_of latter.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@75630 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/ChangeLog | 5 | ||||
-rw-r--r-- | libobjc/sarray.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index f900eafd570..b9913926b74 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,8 @@ +2004-01-09 Andrew Ruder <aeruder@ksu.edu> + + PR libobjc/11904 + * sarray.c (sarray_free): Free array->is_copy_of latter. + 2003-12-01 Zack Weinberg <zack@codesourcery.com> PR 11433 diff --git a/libobjc/sarray.c b/libobjc/sarray.c index 71202cb4581..c37633ba33e 100644 --- a/libobjc/sarray.c +++ b/libobjc/sarray.c @@ -402,9 +402,6 @@ sarray_free (struct sarray *array) { #else old_buckets = array->buckets; #endif - - if ((array->is_copy_of) && ((array->is_copy_of->ref_count - 1) == 0)) - sarray_free (array->is_copy_of); /* Free all entries that do not point to empty_bucket */ for (counter = 0; counter <= old_max_index; counter++ ) { @@ -462,6 +459,10 @@ sarray_free (struct sarray *array) { #endif + /* If this is a copy, go ahead and decrement/deallocate the original */ + if (array->is_copy_of) + sarray_free (array->is_copy_of); + /* free array */ sarray_free_garbage (array); } |