diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-09-28 18:30:25 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-09-28 19:07:52 +0200 |
commit | 7e7f0b08072381b9a4f1ae89172352ee7ee7fab8 (patch) | |
tree | 7d927385085da0924bea6ff7443d308ec9ff2e94 /src | |
parent | 6cf78dc917710a6e6d962f2d7ddaa6137b34ab6d (diff) | |
download | ghdl-7e7f0b08072381b9a4f1ae89172352ee7ee7fab8.tar.gz ghdl-7e7f0b08072381b9a4f1ae89172352ee7ee7fab8.tar.bz2 ghdl-7e7f0b08072381b9a4f1ae89172352ee7ee7fab8.zip |
vhdl-sem_psl: fix crash in case of error in assert statement. Fix #1480
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-sem_psl.adb | 7 |
1 files changed, 5 insertions, 2 deletions
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)); |