From 37d14d91f5883620db6784d548b303c7a6e3f35c Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 14 Apr 2020 17:39:31 +0200 Subject: vhdl: avoid a crash after an error. --- src/vhdl/vhdl-sem_names.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3