diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-12-19 18:09:19 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-12-20 20:58:40 +0100 |
commit | 9db20e133d5c47f8d54710c2676792337cc94f54 (patch) | |
tree | cd2d322740881a3ba063c15167fba96198db0d98 | |
parent | b63411b2dbf125ded19daaf75b920e15ad8f9970 (diff) | |
download | ghdl-9db20e133d5c47f8d54710c2676792337cc94f54.tar.gz ghdl-9db20e133d5c47f8d54710c2676792337cc94f54.tar.bz2 ghdl-9db20e133d5c47f8d54710c2676792337cc94f54.zip |
Fix test failure on unbounded record element due to wrong alignment.
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 32a870536..56f600776 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -1007,9 +1007,17 @@ package body Trans.Chap3 is New_Monadic_Op (ON_Not, Get_Type_Alignmask (Atype))); end Realign; - function Realign (Value : O_Enode; Atype : Iir) return O_Enode is + function Realign (Value : O_Enode; Atype : Iir) return O_Enode + is + Tinfo : constant Type_Info_Acc := Get_Info (Atype); + Otype : O_Tnode; begin - return Realign (Value, Get_Info (Atype).Ortho_Type (Mode_Value)); + if Is_Unbounded_Type (Tinfo) then + Otype := Tinfo.B.Base_Type (Mode_Value); + else + Otype := Tinfo.Ortho_Type (Mode_Value); + end if; + return Realign (Value, Otype); end Realign; function Realign (Value : O_Enode; Mask : O_Dnode) return O_Enode is |