From 4033dd795927a4953879bdc92d395788893a5468 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 24 Jul 2020 18:24:53 +0200 Subject: vhdl-sem_lib: avoid a crash in explain_obsolete. --- src/vhdl/vhdl-sem_lib.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vhdl/vhdl-sem_lib.adb b/src/vhdl/vhdl-sem_lib.adb index 7144d7725..d0db163ca 100644 --- a/src/vhdl/vhdl-sem_lib.adb +++ b/src/vhdl/vhdl-sem_lib.adb @@ -323,7 +323,10 @@ package body Vhdl.Sem_Lib is It := List_Iterate (List); while Is_Valid (It) loop El := Get_Element (It); - if Get_Date (El) = Date_Obsolete then + -- Just handle design unit; but there could also be entity aspects. + if Get_Kind (El) = Iir_Kind_Design_Unit + and then Get_Date (El) = Date_Obsolete + then Error_Obsolete (Loc, "%n is obsoleted by %n", (+Design_Unit, +El)); return; end if; -- cgit v1.2.3