diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-06 09:21:59 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-06 09:21:59 +0000 |
commit | c80139245feaab9a849ac1678c87caff817a58eb (patch) | |
tree | e68b3ce189bed3a993441a405a90602a0c30bea8 | |
parent | 3402506faff248bf79e34951f447f9f161105034 (diff) | |
download | gcc-c80139245feaab9a849ac1678c87caff817a58eb.tar.gz |
2007-04-06 Pascal Obry <obry@adacore.com>
* g-arrspl.adb (Free) [Element_Access]: New routine to free the source
string.
(Create): Free the source string before storing the new one.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123571 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/g-arrspl.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/g-arrspl.adb b/gcc/ada/g-arrspl.adb index 571388ac294..bcbc8c4dbec 100644 --- a/gcc/ada/g-arrspl.adb +++ b/gcc/ada/g-arrspl.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -41,6 +41,9 @@ package body GNAT.Array_Split is procedure Free is new Ada.Unchecked_Deallocation (Separators_Indexes, Indexes_Access); + procedure Free is + new Ada.Unchecked_Deallocation (Element_Sequence, Element_Access); + function Count (Source : Element_Sequence; Pattern : Element_Set) return Natural; @@ -81,6 +84,7 @@ package body GNAT.Array_Split is Mode : Separator_Mode := Single) is begin + Free (S.Source); S.Source := new Element_Sequence'(From); Set (S, Separators, Mode); end Create; |