diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-27 21:09:18 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-27 21:09:18 +0100 |
commit | 93e1e6fa9bd08d36307bd4767e94203ca123fbd5 (patch) | |
tree | e531662781e88c25347bc8653de19e72c3d79009 /src/vhdl/translate/trans-chap6.adb | |
parent | 5e4967dda119ded532aca66be33cf5f8977d43b5 (diff) | |
download | ghdl-93e1e6fa9bd08d36307bd4767e94203ca123fbd5.tar.gz ghdl-93e1e6fa9bd08d36307bd4767e94203ca123fbd5.tar.bz2 ghdl-93e1e6fa9bd08d36307bd4767e94203ca123fbd5.zip |
trans-chap3: unbox recod in Get_Composite_Base.
Fix #467
Diffstat (limited to 'src/vhdl/translate/trans-chap6.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap6.adb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb index 5537890c9..5022d2a64 100644 --- a/src/vhdl/translate/trans-chap6.adb +++ b/src/vhdl/translate/trans-chap6.adb @@ -851,7 +851,14 @@ package body Trans.Chap6 is Stable_Prefix := Prefix; end if; - Base := Chap3.Get_Composite_Base (Stable_Prefix); + if Get_Type_Info (Stable_Prefix).Type_Mode = Type_Mode_Unbounded_Record + then + -- Get the base. + Base := Chap3.Get_Composite_Base (Stable_Prefix); + else + -- Might be a boxed subtype; keep the box to optimize the access. + Base := Stable_Prefix; + end if; Base_Tinfo := Get_Type_Info (Base); Box_Field := Base_Tinfo.S.Box_Field (Kind); @@ -879,7 +886,7 @@ package body Trans.Chap6 is Chararray_Type, New_Value (New_Selected_Element (B, - El_Info.Field_Node (Kind)))), + El_Info.Field_Node (Kind)))), El_Tinfo.B.Base_Ptr_Type (Kind)), El_Tinfo, Kind); else |