diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-01-11 06:58:32 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-01-11 06:58:32 +0100 |
commit | ac3c67cd0aa67f1e01a05821c5088ae70815fc6d (patch) | |
tree | 6811f0f2cb01e2e098845e4e77220200dfd7e66f /src/vhdl | |
parent | 345d783813d79c1431ae5a70bf85dcf775ffe3b5 (diff) | |
download | ghdl-ac3c67cd0aa67f1e01a05821c5088ae70815fc6d.tar.gz ghdl-ac3c67cd0aa67f1e01a05821c5088ae70815fc6d.tar.bz2 ghdl-ac3c67cd0aa67f1e01a05821c5088ae70815fc6d.zip |
trans-chap7: add implicit conversion for unbounded arrays.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index 64cb3ec58..0b1888d31 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -900,6 +900,7 @@ package body Trans.Chap7 is is Ainfo : Type_Info_Acc; Einfo : Type_Info_Acc; + Mode : Object_Kind_Type; begin pragma Assert (Get_Kind (Expr_Type) in Iir_Kinds_Array_Type_Definition); @@ -933,7 +934,13 @@ package body Trans.Chap7 is -- the code is not required to run. Chap6.Gen_Bound_Error (Loc); end if; - return Expr; + -- Convert. For subtypes of arrays with unbounded elements, + -- the subtype can be the same but the ortho type can be + -- different. + Mode := Get_Object_Kind (Expr); + return E2M (New_Convert_Ov (M2Addr (Expr), + Ainfo.Ortho_Ptr_Type (Mode)), + Ainfo, Mode); else -- Unbounded/bounded array to bounded array. return Convert_To_Constrained (Expr, Expr_Type, Res_Type, Loc); |