aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap14.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-07-30 07:17:59 +0200
committerTristan Gingold <tgingold@free.fr>2016-07-30 07:17:59 +0200
commitbcc65a1b73b1ca088100e71f60bf82f6e06bb54e (patch)
treeda2e60bafdf8bb529161b7693a38095b2770f028 /src/vhdl/translate/trans-chap14.adb
parentcbdf92940206f1c0a9093c8164b911b311949408 (diff)
downloadghdl-bcc65a1b73b1ca088100e71f60bf82f6e06bb54e.tar.gz
ghdl-bcc65a1b73b1ca088100e71f60bf82f6e06bb54e.tar.bz2
ghdl-bcc65a1b73b1ca088100e71f60bf82f6e06bb54e.zip
Fix translation of leftof/rightof.
Diffstat (limited to 'src/vhdl/translate/trans-chap14.adb')
-rw-r--r--src/vhdl/translate/trans-chap14.adb6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap14.adb b/src/vhdl/translate/trans-chap14.adb
index 3072b5955..190953058 100644
--- a/src/vhdl/translate/trans-chap14.adb
+++ b/src/vhdl/translate/trans-chap14.adb
@@ -290,6 +290,8 @@ package body Trans.Chap14 is
is
Expr_Type : constant Iir := Get_Type (Attr);
Tinfo : constant Type_Info_Acc := Get_Info (Expr_Type);
+ Prefix_Type : constant Iir :=
+ Get_Type (Get_Named_Entity (Get_Prefix (Attr)));
Ttype : O_Tnode;
Expr : O_Enode;
Is_Inc : Boolean;
@@ -305,10 +307,10 @@ package body Trans.Chap14 is
Is_Inc := False;
when Iir_Kind_Leftof_Attribute =>
Is_Inc :=
- Get_Direction (Get_Range_Constraint (Expr_Type)) = Iir_Downto;
+ Get_Direction (Get_Range_Constraint (Prefix_Type)) = Iir_Downto;
when Iir_Kind_Rightof_Attribute =>
Is_Inc :=
- Get_Direction (Get_Range_Constraint (Expr_Type)) = Iir_To;
+ Get_Direction (Get_Range_Constraint (Prefix_Type)) = Iir_To;
when others =>
Error_Kind ("translate_succ_pred_attribute", Attr);
end case;