From 20e3f9f61762661b5da31cb35971715635010057 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 11 Sep 2021 16:50:10 +0200 Subject: synth-vhdl_stmts: fix crash on nested if-generate statement in vunits. Fix #1859 --- src/synth/synth-vhdl_stmts.adb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/synth/synth-vhdl_stmts.adb') diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb index 25e37be8f..4e7c6963f 100644 --- a/src/synth/synth-vhdl_stmts.adb +++ b/src/synth/synth-vhdl_stmts.adb @@ -3554,6 +3554,7 @@ package body Synth.Vhdl_Stmts is Icond : Node; Cond : Valtyp; Name : Sname; + Config : Node; begin Gen := Stmt; Name := New_Sname_User (Get_Identifier (Stmt), Get_Sname (Syn_Inst)); @@ -3568,8 +3569,10 @@ package body Synth.Vhdl_Stmts is end if; if Cond = No_Valtyp or else Read_Discrete (Cond) = 1 then Bod := Get_Generate_Statement_Body (Gen); - Apply_Block_Configuration - (Get_Generate_Block_Configuration (Bod), Bod); + Config := Get_Generate_Block_Configuration (Bod); + if Config /= Null_Node then + Apply_Block_Configuration (Config, Bod); + end if; Synth_Generate_Statement_Body (Syn_Inst, Bod, Name); exit; end if; -- cgit v1.2.3