OSDN Git Service

* bitmap.c (bitmap_operation): Don't leak bitmap elements.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 20:24:11 +0000 (20:24 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 20:24:11 +0000 (20:24 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32038 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/bitmap.c

index 9248a10..b0e93cd 100644 (file)
@@ -1,3 +1,7 @@
+2000-02-17  Jason Merrill  <jason@casey.cygnus.com>
+
+       * bitmap.c (bitmap_operation): Don't leak bitmap elements.
+
 2000-02-17  Mark Mitchell  <mark@codesourcery.com>
 
        * function.c (thread_prologue_and_epilogue_insns): Put a line note
index f43965c..6c6c978 100644 (file)
@@ -477,7 +477,7 @@ bitmap_operation (to, from1, from2, operation)
          changed = 1;
          to_tmp = to_ptr;
          to_ptr = to_ptr->next;
-         to_tmp = bitmap_free;
+         to_tmp->next = bitmap_free;
          bitmap_free = to_tmp;
        }
       if (to_ptr && to_ptr->indx == indx)
@@ -517,6 +517,11 @@ bitmap_operation (to, from1, from2, operation)
          to_tmp->indx = indx;
          bitmap_element_link (to, to_tmp);
        }
+      else
+       {
+         to_tmp->next = bitmap_free;
+         bitmap_free = to_tmp;
+       }
     }
 
   /* If we have elements of TO left over, free the lot.  */