diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-04-15 07:45:57 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-04-15 07:45:57 +0200 |
commit | e2f0e4b59816b0b64a83fac22614c97a7bd7d85d (patch) | |
tree | b379d953870b39c16cb295d47497066f37159619 /src/synth/synth-decls.adb | |
parent | e5cf1849821cec0f3340babf69c29929d1d25fca (diff) | |
download | ghdl-e2f0e4b59816b0b64a83fac22614c97a7bd7d85d.tar.gz ghdl-e2f0e4b59816b0b64a83fac22614c97a7bd7d85d.tar.bz2 ghdl-e2f0e4b59816b0b64a83fac22614c97a7bd7d85d.zip |
synth: avoid crash in case of non-elaboratable generic.
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r-- | src/synth/synth-decls.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 1539b0039..b9207e0a6 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -792,7 +792,11 @@ package body Synth.Decls is Val := Synth_Subtype_Conversion (Ctxt, Val, Inter_Type, True, Assoc); - pragma Assert (Is_Static (Val.Val)); + if not Is_Static (Val.Val) then + Error_Msg_Synth + (+Assoc, "value of generic %i must be static", +Inter); + Val := No_Valtyp; + end if; Create_Object (Sub_Inst, Inter, Val); |