diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-02-24 17:28:10 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-02-24 21:37:09 +0100 |
commit | 26eeee5d480cbec7f08173c73958940aa7da3188 (patch) | |
tree | cae4d2fa8730c4f47eb3cd5e1680994d9ebfdb91 /src/vhdl/vhdl-sem_psl.adb | |
parent | 8fb84c1ca46c299996886dd22a7796817015c681 (diff) | |
download | ghdl-26eeee5d480cbec7f08173c73958940aa7da3188.tar.gz ghdl-26eeee5d480cbec7f08173c73958940aa7da3188.tar.bz2 ghdl-26eeee5d480cbec7f08173c73958940aa7da3188.zip |
vhdl-sem_psl.adb: don't crash on overload in HDL expr. Fix #1979
Diffstat (limited to 'src/vhdl/vhdl-sem_psl.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_psl.adb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-sem_psl.adb b/src/vhdl/vhdl-sem_psl.adb index 9cd7b52fb..55a4d7257 100644 --- a/src/vhdl/vhdl-sem_psl.adb +++ b/src/vhdl/vhdl-sem_psl.adb @@ -57,9 +57,19 @@ package body Vhdl.Sem_Psl is end Is_Psl_Boolean_Type; -- Return TRUE if EXPR type is a PSL boolean type. - function Is_Psl_Boolean_Expr (Expr : Iir) return Boolean is + function Is_Psl_Boolean_Expr (Expr : Iir) return Boolean + is + Etype : constant Iir := Get_Type (Expr); begin - return Is_Psl_Boolean_Type (Get_Type (Expr)); + -- In case of overload, consider the expression not as a PSL boolean. + -- It couldn't be resolved, so there will be an error, unless the whole + -- property is used in an assertion and the assertion is not considered + -- as a PSL assertion. + if Sem_Names.Is_Overload_List (Etype) then + return False; + end if; + + return Is_Psl_Boolean_Type (Etype); end Is_Psl_Boolean_Expr; function Is_Psl_Bit_Type (Atype : Iir) return Boolean |