Browse Source

compiler: skip functions symtables while generating generic specialization symtable stack (fixes test tw12249.pp and bug #0012249)

git-svn-id: trunk@16476 -
paul 14 years ago
parent
commit
8a5c99599e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/ptype.pas

+ 6 - 1
compiler/ptype.pas

@@ -161,6 +161,7 @@ implementation
         vmtbuilder : TVMTBuilder;
         onlyparsepara : boolean;
         specializest : tsymtable;
+        item: psymtablestackitem;
       begin
         { retrieve generic def that we are going to replace }
         genericdef:=tstoreddef(tt);
@@ -301,7 +302,11 @@ implementation
               symtablestack.push(hmodule.globalsymtable);
 
             { hacky, but necessary to insert the newly generated class properly }
-            symtablestack.push(oldsymtablestack.top);
+            item:=oldsymtablestack.stack;
+            while assigned(item) and (item^.symtable.symtablelevel>main_program_level) do
+              item:=item^.next;
+            if assigned(item) then
+              symtablestack.push(item^.symtable);
 
             { Reparse the original type definition }
             if not err then