From 7e7f0b08072381b9a4f1ae89172352ee7ee7fab8 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 28 Sep 2020 18:30:25 +0200 Subject: vhdl-sem_psl: fix crash in case of error in assert statement. Fix #1480 --- src/vhdl/vhdl-sem_psl.adb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/vhdl-sem_psl.adb b/src/vhdl/vhdl-sem_psl.adb index bcdce2239..341e937a5 100644 --- a/src/vhdl/vhdl-sem_psl.adb +++ b/src/vhdl/vhdl-sem_psl.adb @@ -394,10 +394,13 @@ package body Vhdl.Sem_Psl is if Expr = Null_Iir then return N; end if; - Free_Node (N); Expr_Type := Get_Type (Expr); + if Expr_Type = Null_Iir then + return N; + end if; + Free_Node (N); if not Is_Overload_List (Expr_Type) - and then not Is_Psl_Boolean_Type (Expr_Type) + and then not Is_Psl_Boolean_Type (Expr_Type) then Error_Msg_Sem (+Expr, "type of expression must be boolean"); return PSL.Hash.Get_PSL_Node (HDL_Node (Expr), Get_Location (Expr)); -- cgit v1.2.3