From 983e68ed194f034696a02cea34f55a93ec543018 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 1 Feb 2023 21:12:30 +0100 Subject: vhdl: avoid error storms in assertions --- src/vhdl/vhdl-sem_expr.adb | 2 +- src/vhdl/vhdl-sem_psl.adb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb index 94d0908f4..332a11dfc 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -6071,7 +6071,7 @@ package body Vhdl.Sem_Expr is Cond_Type : Iir; begin Cond_Type := Get_Type (Cond); - if Cond_Type = Null_Iir then + if Cond_Type = Null_Iir or else Is_Error (Cond_Type) then -- Error. return Cond; end if; diff --git a/src/vhdl/vhdl-sem_psl.adb b/src/vhdl/vhdl-sem_psl.adb index f498f0115..06cac1072 100644 --- a/src/vhdl/vhdl-sem_psl.adb +++ b/src/vhdl/vhdl-sem_psl.adb @@ -361,7 +361,9 @@ package body Vhdl.Sem_Psl is if not Is_Overload_List (Expr_Type) and then not Is_Psl_Boolean_Type (Expr_Type) then - Error_Msg_Sem (+Expr, "type of expression must be boolean"); + if Get_Kind (Expr_Type) /= Iir_Kind_Error then + Error_Msg_Sem (+Expr, "type of expression must be boolean"); + end if; return PSL.Hash.Get_PSL_Node (HDL_Node (Expr), Get_Location (Expr)); else return Convert_Bool (Expr); -- cgit v1.2.3