diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-14 17:39:31 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-14 20:29:09 +0200 |
commit | 37d14d91f5883620db6784d548b303c7a6e3f35c (patch) | |
tree | 2dce4c35cdb35d4f51278e8ef434b67876e8c813 | |
parent | 626169d230d08172987f813ff44b0d7b43014250 (diff) | |
download | ghdl-37d14d91f5883620db6784d548b303c7a6e3f35c.tar.gz ghdl-37d14d91f5883620db6784d548b303c7a6e3f35c.tar.bz2 ghdl-37d14d91f5883620db6784d548b303c7a6e3f35c.zip |
vhdl: avoid a crash after an error.
-rw-r--r-- | src/vhdl/vhdl-sem_names.adb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index f67f8f98c..56aab131b 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -4548,7 +4548,10 @@ package body Vhdl.Sem_Names is Set_Named_Entity (Name, Expr); if Expr = Null_Iir then Error_Msg_Sem (+Name, "%n cannot be used as expression", +Name); - return Create_Error_Expr (Name, A_Type); + -- Note: this creates a loop. + Res := Create_Error_Expr (Name, A_Type); + Set_Named_Entity (Name, Res); + return Res; end if; if not Is_Overload_List (Expr) then |