diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-12-26 14:26:59 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-12-26 17:35:10 +0100 |
commit | b9788c0bb2fabdcdd70029cd2ffbdd12706aea1d (patch) | |
tree | eb903a286fca01f9c039f6c69a92e1399a90c84e /src/ghdldrv/ghdlprint.adb | |
parent | f60887e70ac8f2b24637b4710f5cb9a18acef6aa (diff) | |
download | ghdl-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/ghdldrv/ghdlprint.adb')
-rw-r--r-- | src/ghdldrv/ghdlprint.adb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb index 2ddc74e75..79d20c68d 100644 --- a/src/ghdldrv/ghdlprint.adb +++ b/src/ghdldrv/ghdlprint.adb @@ -692,7 +692,9 @@ package body Ghdlprint is Flags.Bootstrap := True; Flags.Flag_Elocations := True; -- Load word library. - Libraries.Load_Std_Library; + if not Libraries.Load_Std_Library then + raise Option_Error; + end if; Libraries.Load_Work_Library; -- First loop: parse source file, check destination file does not @@ -1066,7 +1068,10 @@ package body Ghdlprint is Id : Name_Id; begin if Cmd.Flag_Sem then - Setup_Libraries (True); + -- Libraries are required for semantic analysis. + if not Setup_Libraries (True) then + return; + end if; end if; -- Keep parenthesis during parse. @@ -1437,7 +1442,9 @@ package body Ghdlprint is Flags.Flag_Xref := True; -- Load work library. - Setup_Libraries (True); + if not Setup_Libraries (True) then + return; + end if; Output_Dir := Cmd.Output_Dir; if Output_Dir = null then @@ -1690,7 +1697,9 @@ package body Ghdlprint is Files : File_Data_Array; begin -- Load work library. - Setup_Libraries (True); + if not Setup_Libraries (True) then + return; + end if; Vhdl.Xrefs.Init; Flags.Flag_Xref := True; |