Browse Source

types_dec:
- fix a comment
- the created undefineddef must not be freed, as the count of the list the def is contained in, is used to find other defs again

git-svn-id: branches/svenbarth/generics@19428 -

svenbarth 14 years ago
parent
commit
a93aeebb1f
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/pdecl.pas

+ 3 - 2
compiler/pdecl.pas

@@ -538,7 +538,7 @@ implementation
                       gendef:=tstoreddef(ttypesym(sym).typedef);
                       gendef:=tstoreddef(ttypesym(sym).typedef);
                     end;
                     end;
                 end;
                 end;
-              { insert a newtype if we don't reuse an existing symbol }
+              { insert a new type if we don't reuse an existing symbol }
               if not assigned(newtype) then
               if not assigned(newtype) then
                 begin
                 begin
                   newtype:=ttypesym.create(genorgtypename,hdef);
                   newtype:=ttypesym.create(genorgtypename,hdef);
@@ -592,7 +592,8 @@ implementation
               if isgeneric and assigned(sym) and
               if isgeneric and assigned(sym) and
                   not (m_delphi in current_settings.modeswitches) and
                   not (m_delphi in current_settings.modeswitches) and
                   (ttypesym(sym).typedef.typ=undefineddef) then
                   (ttypesym(sym).typedef.typ=undefineddef) then
-                  { TODO : check whether the undefined def needs to be freed }
+                { don't free the undefineddef as the defids rely on the count
+                  of the defs in the def list of the module}
                 ttypesym(sym).typedef:=hdef;
                 ttypesym(sym).typedef:=hdef;
               newtype.typedef:=hdef;
               newtype.typedef:=hdef;
               { KAZ: handle TGUID declaration in system unit }
               { KAZ: handle TGUID declaration in system unit }