diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-04-23 09:49:43 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-04-23 09:49:43 +0200 |
commit | 71a9d2d734ba1f613ae37fca73c19854751fe5f2 (patch) | |
tree | 11118a32e79881ad90765198c62ca7cb47090b42 | |
parent | 2d34c88b80275b5812ac62a3bf83354c41494265 (diff) | |
download | ghdl-71a9d2d734ba1f613ae37fca73c19854751fe5f2.tar.gz ghdl-71a9d2d734ba1f613ae37fca73c19854751fe5f2.tar.bz2 ghdl-71a9d2d734ba1f613ae37fca73c19854751fe5f2.zip |
vhdl-configuration(Find_Top_Entity): avoid a crash after an error
-rw-r--r-- | src/vhdl/vhdl-configuration.adb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb index b17a5d2c5..b9fd1bc6c 100644 --- a/src/vhdl/vhdl-configuration.adb +++ b/src/vhdl/vhdl-configuration.adb @@ -923,6 +923,10 @@ package body Vhdl.Configuration is null; end case; + if Nbr_Errors /= 0 then + return Walk_Abort; + end if; + return Walk_Continue; end Add_Entity_Cb; @@ -1061,6 +1065,9 @@ package body Vhdl.Configuration is -- 1. Add all design entities in the name table. Status := Walk_Design_Units (Lib, Add_Entity_Cb'Access); + if Status = Walk_Abort then + return; + end if; pragma Assert (Status = Walk_Continue); -- 2. Walk architecture and configurations, and mark instantiated @@ -1117,6 +1124,10 @@ package body Vhdl.Configuration is begin -- FROM is a library or a design file. Top.Mark_Instantiated_Units (From, Loc); + if Nbr_Errors > 0 then + return Null_Iir; + end if; + Top.Find_First_Top_Entity (From); if Top.Nbr_Top_Entities = 1 then |