From 1abc9c1fe722c9c20d92fdefd9504b8c5805e890 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Sun, 24 Nov 2019 00:04:31 +0000 Subject: [PATCH] * when specializing a routine all nested specializations must go to the para- or localsymtable as otherwise the symbol can't be found to be registered git-svn-id: trunk@43568 - --- compiler/pgenutil.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas index 4c4ec77117..3c60145bd6 100644 --- a/compiler/pgenutil.pas +++ b/compiler/pgenutil.pas @@ -862,7 +862,13 @@ uses { decide in which symtable to put the specialization } if parse_generic and not assigned(result) then begin - if assigned(current_procinfo) and (df_generic in current_procinfo.procdef.defoptions) then + srsymtable:=symtablestack.top; + if (srsymtable.symtabletype in [localsymtable,parasymtable]) and tstoreddef(srsymtable.defowner).is_specialization then + { if we are currently specializing a routine we need to specialize into + the routine's local- or parasymtable so that they are correctly + registered should the specialization be finalized } + specializest:=srsymtable + else if assigned(current_procinfo) and (df_generic in current_procinfo.procdef.defoptions) then { if we are parsing the definition of a method we specialize into the local symtable of it } specializest:=current_procinfo.procdef.getsymtable(gs_local)