From 26eeee5d480cbec7f08173c73958940aa7da3188 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 24 Feb 2022 17:28:10 +0100 Subject: vhdl-sem_psl.adb: don't crash on overload in HDL expr. Fix #1979 --- src/vhdl/vhdl-sem_psl.adb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/vhdl/vhdl-sem_psl.adb') 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 -- cgit v1.2.3