diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-11 05:47:32 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-11 05:47:32 +0100 |
commit | c0a985bb4a50e42a80d177de03f529a4ca792895 (patch) | |
tree | 8202d474e5750dac111228a22a17481d631f3e74 /src/synth | |
parent | 9e33bb7142f7bfcec6260426f92b6f5fe372a765 (diff) | |
download | ghdl-c0a985bb4a50e42a80d177de03f529a4ca792895.tar.gz ghdl-c0a985bb4a50e42a80d177de03f529a4ca792895.tar.bz2 ghdl-c0a985bb4a50e42a80d177de03f529a4ca792895.zip |
synth: add a check for v87 concatenations
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-vhdl_eval.adb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/synth/synth-vhdl_eval.adb b/src/synth/synth-vhdl_eval.adb index ddc9e7052..f9bb11089 100644 --- a/src/synth/synth-vhdl_eval.adb +++ b/src/synth/synth-vhdl_eval.adb @@ -1305,7 +1305,7 @@ package body Synth.Vhdl_Eval is end if; if Vhdl_Std > Vhdl_87 then Bnd := Elab.Vhdl_Types.Create_Bounds_From_Length - (Get_Uarray_Index (Res_Typ).Drange, L_Len + R_Len); + (Res_Typ.Uarr_Idx.Drange, L_Len + R_Len); else -- LRM87 7.2.3 -- [...], unless the left operand is a null array, in which @@ -1331,6 +1331,11 @@ package body Synth.Vhdl_Eval is when Dir_Downto => Bnd.Right := Bnd.Left - Int32 (L_Len + R_Len - 1); end case; + if not In_Range (Res_Typ.Uarr_Idx.Drange, Int64 (Bnd.Right)) + then + Error_Msg_Synth (Inst, Expr, "bound not in range"); + return Null_Memtyp; + end if; end if; El_Typ := Unshare_Type_Expr (Le_Typ, Get_Array_Element (Res_Typ)); |