From bf6e854674991dafedb73a2fbfe9e5af190d5190 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 21 Feb 2020 06:48:07 +0100 Subject: synth-decls: handle alias declaration without subtype indication. Fix #1144 --- src/synth/synth-decls.adb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 92670c49f..f5a65e370 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -650,8 +650,8 @@ package body Synth.Decls is Create_Var_Wire (Syn_Inst, Decl, Init); end; when Iir_Kind_Object_Alias_Declaration => - Synth_Declaration_Type (Syn_Inst, Decl); declare + Atype : constant Node := Get_Type (Decl); Obj : Value_Acc; Off : Uns32; Voff : Net; @@ -660,7 +660,12 @@ package body Synth.Decls is Res : Value_Acc; Obj_Type : Type_Acc; begin - Obj_Type := Get_Value_Type (Syn_Inst, Get_Type (Decl)); + -- Subtype indication may not be present. + if Is_Anonymous_Type_Definition (Atype) then + Synth_Subtype_Indication (Syn_Inst, Atype); + end if; + Obj_Type := Get_Value_Type (Syn_Inst, Atype); + Stmts.Synth_Assignment_Prefix (Syn_Inst, Get_Name (Decl), Obj, Off, Voff, Rdwd, Typ); pragma Assert (Voff = No_Net); -- cgit v1.2.3