diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-07 04:47:36 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-07 04:47:36 +0200 |
commit | 0464fc08590bf4f8cc9d011ff26b4e726134d5dd (patch) | |
tree | 054e39332b45f667cc358f7d2d016a7a37eb3280 | |
parent | d122be7d9b90f4cad3905f95d9e1f4560ddde9c5 (diff) | |
download | ghdl-0464fc08590bf4f8cc9d011ff26b4e726134d5dd.tar.gz ghdl-0464fc08590bf4f8cc9d011ff26b4e726134d5dd.tar.bz2 ghdl-0464fc08590bf4f8cc9d011ff26b4e726134d5dd.zip |
elab-vhdl_context: also handle generic subprograms
-rw-r--r-- | src/synth/elab-vhdl_context.adb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/synth/elab-vhdl_context.adb b/src/synth/elab-vhdl_context.adb index f46418a6d..95b9ddf29 100644 --- a/src/synth/elab-vhdl_context.adb +++ b/src/synth/elab-vhdl_context.adb @@ -513,7 +513,9 @@ package body Elab.Vhdl_Context is function Get_Instance_By_Scope (Syn_Inst: Synth_Instance_Acc; Scope: Sim_Info_Acc) - return Synth_Instance_Acc is + return Synth_Instance_Acc + is + pragma Assert (Scope /= null); begin case Scope.Kind is when Kind_Block @@ -524,7 +526,9 @@ package body Elab.Vhdl_Context is begin Current := Syn_Inst; while Current /= null loop - if Current.Block_Scope = Scope then + if Current.Block_Scope = Scope + or else Current.Uninst_Scope = Scope + then return Current; end if; Current := Current.Up_Block; |