From b715bc599a55f42755101f1976a9c599308f27f9 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 2 Aug 2011 15:02:09 +0200 Subject: [PATCH] [multiple changes] 2011-08-02 Gary Dismukes * 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 * switch-c.adb (Free): New deallocation procedure to avoid implicitly using the one from System.Strings, which also deallocates all strings. From-SVN: r177142 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/sem_ch3.adb | 7 +++++-- gcc/ada/switch-c.adb | 5 +++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d249de0df52..7495e774ef7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2011-08-02 Gary Dismukes + + * 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 + + * 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 * gcc-interface/gigi.h, gcc-interface/misc.c (enumerate_modes): New diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 36563286d87..30fb8782d2e 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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); diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index bda476bdf97..177f53687b6 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -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; -- 2.30.2