From c231a008f41049bd6b92061b353099002d7bef1e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 3 Jul 2020 08:07:07 +0200 Subject: synth-decls: avoid elaboration crash after global signals. For #1387 --- src/synth/synth-decls.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 7c6f7a107..40c2fe5f2 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -902,12 +902,14 @@ package body Synth.Decls is Init : Valtyp; Obj_Typ : Type_Acc; begin + Synth_Declaration_Type (Syn_Inst, Decl); if Get_Kind (Get_Parent (Decl)) = Iir_Kind_Package_Declaration then Error_Msg_Synth (+Decl, "signals in packages are not supported"); + -- Avoid elaboration error. + Create_Object (Syn_Inst, Decl, No_Valtyp); return; end if; - Synth_Declaration_Type (Syn_Inst, Decl); Create_Wire_Object (Syn_Inst, Wire_Signal, Decl); if Is_Valid (Def) then Obj_Typ := Get_Subtype_Object (Syn_Inst, Get_Type (Decl)); -- cgit v1.2.3