aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-vstrings.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-06-02 21:12:53 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-02 21:13:41 +0200
commita4b7cbfcd6a8e90471373f852d0ce3e15054c8c4 (patch)
tree2c00b945292d0e20632fee7429cd51eb06430a28 /src/grt/grt-vstrings.adb
parentdfbbed7c92715eb8ac4ac634076c29148e56a872 (diff)
downloadghdl-a4b7cbfcd6a8e90471373f852d0ce3e15054c8c4.tar.gz
ghdl-a4b7cbfcd6a8e90471373f852d0ce3e15054c8c4.tar.bz2
ghdl-a4b7cbfcd6a8e90471373f852d0ce3e15054c8c4.zip
grt-vstrings: do not depend on grt.errors
Diffstat (limited to 'src/grt/grt-vstrings.adb')
-rw-r--r--src/grt/grt-vstrings.adb7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/grt/grt-vstrings.adb b/src/grt/grt-vstrings.adb
index fe1dc8040..31af49209 100644
--- a/src/grt/grt-vstrings.adb
+++ b/src/grt/grt-vstrings.adb
@@ -23,7 +23,6 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
-with Grt.Errors; use Grt.Errors;
with Grt.C; use Grt.C;
package body Grt.Vstrings is
@@ -60,7 +59,8 @@ package body Grt.Vstrings is
Vstr.Str := To_Ghdl_C_String
(Realloc (To_Address (Vstr.Str), size_t (Nmax)));
if Vstr.Str = null then
- Internal_Error ("grt.vstrings.grow: memory exhausted");
+ -- Memory exhausted.
+ raise Storage_Error;
end if;
Vstr.Max := Nmax;
end Grow;
@@ -97,7 +97,8 @@ package body Grt.Vstrings is
procedure Truncate (Vstr : in out Vstring; Len : Natural) is
begin
if Len > Vstr.Len then
- Internal_Error ("grt.vstrings.truncate: bad len");
+ -- Incorrect length.
+ raise Constraint_Error;
end if;
Vstr.Len := Len;
end Truncate;