2011-08-02 Gary Dismukes <dismukes@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Aug 2011 13:02:09 +0000 (13:02 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Aug 2011 13:02:09 +0000 (13:02 +0000)
* sem_ch3.adb (Complete_Private_Subtype): Don't append the private
subtype's list of rep items to the list on the full subtype in the case
where the lists are the same.

2011-08-02  Geert Bosch  <bosch@adacore.com>

* switch-c.adb (Free): New deallocation procedure to avoid implicitly
using the one from System.Strings, which also deallocates all strings.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177142 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/ada/switch-c.adb

index d249de0..7495e77 100644 (file)
@@ -1,3 +1,14 @@
+2011-08-02  Gary Dismukes  <dismukes@adacore.com>
+
+       * sem_ch3.adb (Complete_Private_Subtype): Don't append the private
+       subtype's list of rep items to the list on the full subtype in the case
+       where the lists are the same.
+
+2011-08-02  Geert Bosch  <bosch@adacore.com>
+
+       * switch-c.adb (Free): New deallocation procedure to avoid implicitly
+       using the one from System.Strings, which also deallocates all strings.
+
 2011-08-02  Geert Bosch  <bosch@adacore.com>
 
        * gcc-interface/gigi.h, gcc-interface/misc.c (enumerate_modes): New
index 3656328..30fb878 100644 (file)
@@ -10167,9 +10167,12 @@ package body Sem_Ch3 is
          if No (Item) then
             Set_First_Rep_Item (Full, First_Rep_Item (Priv));
 
-         --  Else search to end of items currently linked to the full subtype
+         --  Otherwise, search to the end of items currently linked to the full
+         --  subtype and append the private items to the end. However, if Priv
+         --  and Full already have the same list of rep items, then the append
+         --  is not done, as that would create a circularity.
 
-         else
+         elsif Item /= First_Rep_Item (Priv) then
             loop
                Next_Item := Next_Rep_Item (Item);
                exit when No (Next_Item);
index bda476b..177f536 100644 (file)
@@ -35,6 +35,7 @@ with Validsw;  use Validsw;
 with Stylesw;  use Stylesw;
 with Warnsw;   use Warnsw;
 
+with Ada.Unchecked_Deallocation;
 with System.WCh_Con; use System.WCh_Con;
 
 package body Switch.C is
@@ -45,6 +46,10 @@ package body Switch.C is
    procedure Add_Symbol_Definition (Def : String);
    --  Add a symbol definition from the command line
 
+   procedure Free is
+      new Ada.Unchecked_Deallocation (String_List, String_List_Access);
+   --  Avoid using System.Strings.Free, which also frees the designated strings
+
    function Switch_Subsequently_Cancelled
      (C        : String;
       Args     : String_List;