diff options
author | Tristan Gingold <tgingold@free.fr> | 2013-12-28 07:07:53 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2013-12-28 07:07:53 +0100 |
commit | de125c89facb70964e7a55a984f7cf44ab6829d6 (patch) | |
tree | 081ca886af2b7fcb4d9385c6ea7b1abfb2b023f4 | |
parent | ef39d5386d82a6ed51c5a15572f86c393cd899ac (diff) | |
download | ghdl-de125c89facb70964e7a55a984f7cf44ab6829d6.tar.gz ghdl-de125c89facb70964e7a55a984f7cf44ab6829d6.tar.bz2 ghdl-de125c89facb70964e7a55a984f7cf44ab6829d6.zip |
Check that parameter of signal attributes is static (ticket #1)
-rw-r--r-- | sem_names.adb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sem_names.adb b/sem_names.adb index ef68aa16c..c6ccf68e6 100644 --- a/sem_names.adb +++ b/sem_names.adb @@ -873,7 +873,16 @@ package body Sem_Names is Error_Msg_Sem ("'transaction does not allow a parameter", Attr); else Param := Sem_Expression (Parameter, Time_Subtype_Definition); - Set_Parameter (Attr, Param); + if Param /= Null_Iir then + -- LRM93 14.1 + -- Parameter: A static expression of type TIME [that evaluate + -- to a nonnegative value.] + if Get_Expr_Staticness (Param) = None then + Error_Msg_Sem + ("parameter of signal attribute must be static", Param); + end if; + Set_Parameter (Attr, Param); + end if; end if; end Finish_Sem_Signal_Attribute; |