diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-08-26 05:22:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-08-26 05:22:20 +0200 |
commit | 9664075eef2034c4ef2af28d6aac092aa854cbf4 (patch) | |
tree | ce6469c3751b96a32f2cc694d068aa4c3f24acfd /src/vhdl | |
parent | b11f2f9a723a2919b236ed6f2ffa8dd1cbc3c1f0 (diff) | |
download | ghdl-9664075eef2034c4ef2af28d6aac092aa854cbf4.tar.gz ghdl-9664075eef2034c4ef2af28d6aac092aa854cbf4.tar.bz2 ghdl-9664075eef2034c4ef2af28d6aac092aa854cbf4.zip |
Avoid crash on invalid selection of a procedure.
Fixes #140
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/sem_expr.adb | 10 | ||||
-rw-r--r-- | src/vhdl/sem_names.adb | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb index 4f6ec0df8..e93532fb4 100644 --- a/src/vhdl/sem_expr.adb +++ b/src/vhdl/sem_expr.adb @@ -1385,12 +1385,18 @@ package body Sem_Expr is -- Only one interpretation for the subprogram name. if Is_Func then if Get_Kind (Inter_List) /= Iir_Kind_Function_Declaration then - Error_Msg_Sem (+Expr, "name does not designate a function"); + Error_Msg_Sem (+Expr, "name does not designate a function", + Cont => True); + Error_Msg_Sem (+Expr, "name is %n defined at %l", + (+Inter_List, +Inter_List)); return Null_Iir; end if; else if Get_Kind (Inter_List) /= Iir_Kind_Procedure_Declaration then - Error_Msg_Sem (+Expr, "name does not designate a procedure"); + Error_Msg_Sem (+Expr, "name does not designate a procedure", + Cont => True); + Error_Msg_Sem (+Expr, "name is %n defined at %l", + (+Inter_List, +Inter_List)); return Null_Iir; end if; end if; diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index 5e1ad2cc1..6c25b812c 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -2053,7 +2053,8 @@ package body Sem_Names is | Iir_Kind_Subtype_Declaration | Iir_Kind_Concurrent_Procedure_Call_Statement | Iir_Kind_Component_Instantiation_Statement - | Iir_Kind_Slice_Name => + | Iir_Kind_Slice_Name + | Iir_Kind_Procedure_Call_Statement => Error_Msg_Sem (+Prefix_Loc, "%n cannot be selected by name", +Prefix); |