aboutsummaryrefslogtreecommitdiffstats
path: root/src/libraries.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-12-26 14:26:59 +0100
committerTristan Gingold <tgingold@free.fr>2020-12-26 17:35:10 +0100
commitb9788c0bb2fabdcdd70029cd2ffbdd12706aea1d (patch)
treeeb903a286fca01f9c039f6c69a92e1399a90c84e /src/libraries.adb
parentf60887e70ac8f2b24637b4710f5cb9a18acef6aa (diff)
downloadghdl-b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d.tar.gz
ghdl-b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d.tar.bz2
ghdl-b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d.zip
libraries: Load_Std_Library: now return a status.
Propagate this change to libghdl and python binding to avoid abort. For #1551
Diffstat (limited to 'src/libraries.adb')
-rw-r--r--src/libraries.adb11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libraries.adb b/src/libraries.adb
index d7ff72a85..42228ea6c 100644
--- a/src/libraries.adb
+++ b/src/libraries.adb
@@ -630,15 +630,13 @@ package body Libraries is
end Load_Library;
-- Note: the scanner shouldn't be in use, since this procedure uses it.
- procedure Load_Std_Library (Build_Standard : Boolean := True)
+ function Load_Std_Library (Build_Standard : Boolean := True) return Boolean
is
use Vhdl.Std_Package;
Dir : Name_Id;
begin
- if Libraries_Chain /= Null_Iir then
- -- This procedure must not be called twice.
- raise Internal_Error;
- end if;
+ -- This procedure must not be called twice.
+ pragma Assert (Libraries_Chain = Null_Iir);
Flags.Create_Flag_String;
@@ -668,7 +666,7 @@ package body Libraries is
and then not Flags.Bootstrap
then
Error_Msg_Option ("cannot find ""std"" library");
- raise Option_Error;
+ return False;
end if;
if Build_Standard then
@@ -682,6 +680,7 @@ package body Libraries is
end if;
Set_Visible_Flag (Std_Library, True);
+ return True;
end Load_Std_Library;
procedure Load_Work_Library (Empty : Boolean := False)