diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-30 01:20:51 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-30 01:20:51 +0200 |
commit | e7c2690467b8f0fc3ac85f07843b45723204c86e (patch) | |
tree | fb41f04c9a052f0cf5bf8d61e36205d63db4ec9b | |
parent | 108c48221f7a367b2b33499b469eab0afcaafd43 (diff) | |
download | ghdl-e7c2690467b8f0fc3ac85f07843b45723204c86e.tar.gz ghdl-e7c2690467b8f0fc3ac85f07843b45723204c86e.tar.bz2 ghdl-e7c2690467b8f0fc3ac85f07843b45723204c86e.zip |
synth: convert subtype in alias declaration. Fix #946
-rw-r--r-- | src/synth/synth-decls.adb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 9b5fbad14..24f4aa9cf 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -540,11 +540,15 @@ package body Synth.Decls is Obj : Value_Acc; Off : Uns32; Typ : Type_Acc; + Res : Value_Acc; + Obj_Type : Type_Acc; begin + Obj_Type := Get_Value_Type (Syn_Inst, Get_Type (Decl)); Stmts.Synth_Assignment_Prefix (Syn_Inst, Get_Name (Decl), Obj, Off, Typ); - Create_Object (Syn_Inst, Decl, - Create_Value_Alias (Obj, Off, Typ)); + Res := Create_Value_Alias (Obj, Off, Typ); + Res := Synth_Subtype_Conversion (Res, Obj_Type, True, Decl); + Create_Object (Syn_Inst, Decl, Res); end; when Iir_Kind_Anonymous_Signal_Declaration => Make_Object (Syn_Inst, Wire_Signal, Decl); |