aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-decls.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-21 06:48:07 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-21 06:48:07 +0100
commitbf6e854674991dafedb73a2fbfe9e5af190d5190 (patch)
treeed9f5e0be01266d876fea6aa5e4b9ada265d2b71 /src/synth/synth-decls.adb
parentcf9d17b816445b414bf1855bff8bd070ea4da1b6 (diff)
downloadghdl-bf6e854674991dafedb73a2fbfe9e5af190d5190.tar.gz
ghdl-bf6e854674991dafedb73a2fbfe9e5af190d5190.tar.bz2
ghdl-bf6e854674991dafedb73a2fbfe9e5af190d5190.zip
synth-decls: handle alias declaration without subtype indication.
Fix #1144
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r--src/synth/synth-decls.adb9
1 files changed, 7 insertions, 2 deletions
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);