]> gcc.gnu.org Git - gcc.git/commitdiff
re PR libobjc/11904 (Problem in sarray_free() function.)
authorAndrew Ruder <aeruder@ksu.edu>
Sat, 10 Jan 2004 05:47:42 +0000 (05:47 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Sat, 10 Jan 2004 05:47:42 +0000 (21:47 -0800)
2004-01-09  Andrew Ruder  <aeruder@ksu.edu>

        PR libobjc/11904
        * sarray.c (sarray_free): Free array->is_copy_of latter.

From-SVN: r75630

libobjc/ChangeLog
libobjc/sarray.c

index f900eafd57024584346314ed41b4a9e4a8da68ea..b9913926b7433a9fe8b092993c48d58d5a3e9c02 100644 (file)
@@ -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
index 71202cb458178a1464f794c81977ec615d36f3cb..c37633ba33e73d6ae5234a0594eba6e55b533897 100644 (file)
@@ -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);
 }
This page took 0.06758 seconds and 5 git commands to generate.