aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-07-27 05:28:41 +0200
committerTristan Gingold <tgingold@free.fr>2022-07-27 05:28:41 +0200
commitb6a5511c44066ff38b9efee0e3eaff0aa4dda973 (patch)
tree349dbebe977f9683542f64263f6350bd25749751 /src
parent4d2ef5b79a3b4e0a6eb7ce8a3c6aeca7d468797c (diff)
downloadghdl-b6a5511c44066ff38b9efee0e3eaff0aa4dda973.tar.gz
ghdl-b6a5511c44066ff38b9efee0e3eaff0aa4dda973.tar.bz2
ghdl-b6a5511c44066ff38b9efee0e3eaff0aa4dda973.zip
elab-vhdl_expr: fix incorrect type of multi-dim array indexing during elab
Fix #2143
Diffstat (limited to 'src')
-rw-r--r--src/synth/elab-vhdl_expr.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_expr.adb b/src/synth/elab-vhdl_expr.adb
index 3693f3249..4da248c64 100644
--- a/src/synth/elab-vhdl_expr.adb
+++ b/src/synth/elab-vhdl_expr.adb
@@ -754,6 +754,10 @@ package body Elab.Vhdl_Expr is
Exec_Indexed_Name (Syn_Inst, Pfx, Dest_Typ, Off);
Dest_Off := Dest_Off + Off;
+
+ while not Dest_Typ.Alast loop
+ Dest_Typ := Get_Array_Element (Dest_Typ);
+ end loop;
Dest_Typ := Get_Array_Element (Dest_Typ);
end;
@@ -791,6 +795,11 @@ package body Elab.Vhdl_Expr is
Dest_Off.Mem_Off := Dest_Off.Mem_Off + Sl_Off.Mem_Off;
end;
+ when Iir_Kind_Function_Call =>
+ Dest_Base := Synth_Expression (Syn_Inst, Pfx);
+ Dest_Typ := Dest_Base.Typ;
+ Dest_Off := (0, 0);
+
when others =>
Error_Kind ("exec_assignment_prefix", Pfx);
end case;