diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-09-12 16:21:15 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-09-12 16:21:15 +0200 |
commit | a15dff39e8131feaaecb04550bd1eeb2d1470b21 (patch) | |
tree | 910ada900dc5575089cb1fa0d42f8e31478df73e /src/vhdl | |
parent | 0277de7a78cc62abd3d1a17e1cdc754da7f55361 (diff) | |
download | ghdl-a15dff39e8131feaaecb04550bd1eeb2d1470b21.tar.gz ghdl-a15dff39e8131feaaecb04550bd1eeb2d1470b21.tar.bz2 ghdl-a15dff39e8131feaaecb04550bd1eeb2d1470b21.zip |
trans-chap8: fix crash for slice in target aggregate. Fix #786
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/translate/trans-chap8.adb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |