From 727f3514973a5ec8b7fc86bd8db6611585bd9217 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 4 Jan 2020 17:52:47 +0100 Subject: vhdl/translate: handle more partially constrained array subtypes. For #1038 --- src/vhdl/translate/trans-chap6.adb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/vhdl/translate/trans-chap6.adb') diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb index eb757d9c7..e21836a28 100644 --- a/src/vhdl/translate/trans-chap6.adb +++ b/src/vhdl/translate/trans-chap6.adb @@ -865,6 +865,7 @@ package body Trans.Chap6 is (Prefix : Mnode; El : Iir_Element_Declaration) return Mnode is El_Type : constant Iir := Get_Type (El); + El_Btype : constant Iir := Get_Base_Type (El_Type); El_Tinfo : constant Type_Info_Acc := Get_Info (El_Type); Kind : constant Object_Kind_Type := Get_Object_Kind (Prefix); Base_El : constant Iir := Get_Base_Element_Declaration (El); @@ -963,8 +964,10 @@ package body Trans.Chap6 is if Is_Unbounded_Type (El_Tinfo) then -- Ok, we know that Get_Composite_Base doesn't return a copy. - New_Assign_Stmt (M2Lp (Chap3.Get_Composite_Base (Fat_Res)), - M2Addr (Res)); + New_Assign_Stmt + (M2Lp (Chap3.Get_Composite_Base (Fat_Res)), + New_Convert_Ov (M2Addr (Res), + Get_Info (El_Btype).B.Base_Ptr_Type (Kind))); return Fat_Res; else return Res; -- cgit v1.2.3