From 16eb29c7ca5928517d7a49c77deae6d1f6c9437b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 8 Aug 2019 05:23:02 +0200 Subject: synth: fix crash when assignment target is an aggregate. For tgingold/ghdlsynth-beta#26 --- src/synth/synth-stmts.adb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/synth') diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index f3623960a..85b4ed9d2 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -215,11 +215,13 @@ package body Synth.Stmts is Val : Value_Acc; begin -- FIXME: correctly handle target type when it is a slice. - if Get_Kind (Target) = Iir_Kind_Slice_Name then - Wf_Type := Null_Node; - else - Wf_Type := Get_Type (Target); - end if; + case Get_Kind (Target) is + when Iir_Kind_Slice_Name + | Iir_Kind_Aggregate => + Wf_Type := Null_Node; + when others => + Wf_Type := Get_Type (Target); + end case; Val := Synth_Waveform (Syn_Inst, Get_Waveform_Chain (Stmt), Wf_Type); Synth_Assignment (Syn_Inst, Target, Val, Stmt); end Synth_Simple_Signal_Assignment; -- cgit v1.2.3