diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-05 07:49:12 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-05 07:53:13 +0100 |
commit | eb461d9a6f010d9cb77a0cee6e9850b1aee0dcf7 (patch) | |
tree | d3108e17f244f78f75690b4c357d5eb1ecf6e529 /src/vhdl/translate/trans-chap6.adb | |
parent | f18b2d8c37f0b7a469b89de30fe964c5db580c64 (diff) | |
download | ghdl-eb461d9a6f010d9cb77a0cee6e9850b1aee0dcf7.tar.gz ghdl-eb461d9a6f010d9cb77a0cee6e9850b1aee0dcf7.tar.bz2 ghdl-eb461d9a6f010d9cb77a0cee6e9850b1aee0dcf7.zip |
Handle complex subtype in unbounded records.
Diffstat (limited to 'src/vhdl/translate/trans-chap6.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap6.adb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb index 3c2b55cf1..5838562f3 100644 --- a/src/vhdl/translate/trans-chap6.adb +++ b/src/vhdl/translate/trans-chap6.adb @@ -855,11 +855,22 @@ package body Trans.Chap6 is Base_Tinfo := Get_Type_Info (Base); Box_Field := Base_Tinfo.S.Box_Field (Kind); - if Box_Field = O_Fnode_Null + if (Box_Field = O_Fnode_Null + or else Get_Type_Staticness (El_Type) /= Locally) and then (Is_Complex_Type (El_Tinfo) or Is_Unbounded_Type (El_Tinfo)) then - -- The element is complex: it's an offset. Stabilize (Base); + + if Box_Field /= O_Fnode_Null + and then Get_Type_Staticness (El_Type) /= Locally + then + -- Unbox. + B := New_Selected_Element (M2Lv (Base), Box_Field); + else + B := M2Lv (Base); + end if; + + -- The element is complex: it's an offset. Res := E2M (New_Unchecked_Address (New_Slice @@ -867,7 +878,7 @@ package body Trans.Chap6 is (New_Unchecked_Address (M2Lv (Base), Char_Ptr_Type)), Chararray_Type, New_Value - (New_Selected_Element (M2Lv (Base), + (New_Selected_Element (B, El_Info.Field_Node (Kind)))), El_Tinfo.B.Base_Ptr_Type (Kind)), El_Tinfo, Kind); |