summaryrefslogtreecommitdiff
path: root/libraries.adb
diff options
context:
space:
mode:
authorgingold2008-07-22 01:31:51 +0000
committergingold2008-07-22 01:31:51 +0000
commita504004319b2d42687150cfadbc0fd375c4496b8 (patch)
tree042a9637fa15bfa90e7f66a0d0c96285962f9845 /libraries.adb
parenta069fb4da43fe6f570cdbbc4ed05043f24c9b7a2 (diff)
downloadghdl-a504004319b2d42687150cfadbc0fd375c4496b8.tar.gz
ghdl-a504004319b2d42687150cfadbc0fd375c4496b8.tar.bz2
ghdl-a504004319b2d42687150cfadbc0fd375c4496b8.zip
Avoid crash when pathes are too long.
Diffstat (limited to 'libraries.adb')
-rw-r--r--libraries.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/libraries.adb b/libraries.adb
index f06bd16..b52a11d 100644
--- a/libraries.adb
+++ b/libraries.adb
@@ -75,8 +75,12 @@ package body Libraries is
if Path'Length = 0 then
return;
end if;
- Pathes.Increment_Last;
- Pathes.Table (Pathes.Last) := Path_To_Id (Path);
+ -- Nice message instead of constraint_error.
+ if Path'Length + 2 >= Name_Buffer'Length then
+ Error_Msg ("argument of -P is too long");
+ return;
+ end if;
+ Pathes.Append (Path_To_Id (Path));
end Add_Library_Path;
function Get_Nbr_Pathes return Natural is