From e2f0e4b59816b0b64a83fac22614c97a7bd7d85d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 15 Apr 2021 07:45:57 +0200 Subject: synth: avoid crash in case of non-elaboratable generic. --- src/synth/synth-insts.adb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/synth/synth-insts.adb') diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb index 5937a793e..250fbcf61 100644 --- a/src/synth/synth-insts.adb +++ b/src/synth/synth-insts.adb @@ -994,9 +994,11 @@ package body Synth.Insts is Inter := Get_Generic_Chain (Inst_Obj.Decl); while Inter /= Null_Node loop Vt := Get_Value (Inst_Obj.Syn_Inst, Inter); - Pv := Memtyp_To_Pval (Get_Memtyp (Vt)); - Set_Param_Pval (Inst, Idx, Pv); - + if Vt /= No_Valtyp then + -- Avoid errors + Pv := Memtyp_To_Pval (Get_Memtyp (Vt)); + Set_Param_Pval (Inst, Idx, Pv); + end if; Inter := Get_Chain (Inter); Idx := Idx + 1; end loop; -- cgit v1.2.3