From ac3c67cd0aa67f1e01a05821c5088ae70815fc6d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 11 Jan 2019 06:58:32 +0100 Subject: trans-chap7: add implicit conversion for unbounded arrays. --- src/vhdl/translate/trans-chap7.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3