From a15dff39e8131feaaecb04550bd1eeb2d1470b21 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 12 Sep 2021 16:21:15 +0200 Subject: trans-chap8: fix crash for slice in target aggregate. Fix #786 --- src/vhdl/translate/trans-chap8.adb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vhdl') diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb index d9616fa97..35ff258cb 100644 --- a/src/vhdl/translate/trans-chap8.adb +++ b/src/vhdl/translate/trans-chap8.adb @@ -4240,6 +4240,9 @@ package body Trans.Chap8 is Sub_Type := Get_Element_Subtype (Target_Type); else Sub_Type := Get_Type (Expr); + if Get_Kind (Expr) = Iir_Kind_Slice_Name then + Chap3.Create_Composite_Subtype (Sub_Type, False); + end if; Sub_Aggr := Chap3.Slice_Base (Aggr, Sub_Type, New_Obj_Value (Idx), O_Enode_Null); end if; @@ -4260,6 +4263,7 @@ package body Trans.Chap8 is Chap3.Get_Array_Length (Sub_Aggr, Sub_Type))); end if; else + -- TODO raise Internal_Error; end if; else -- cgit v1.2.3