Selaa lähdekoodia

* prevent new definitions being added to a global unit symtable after compilation of the implementation part started

git-svn-id: trunk@29811 -
florian 10 vuotta sitten
vanhempi
commit
a5bef2a2b9
2 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 2 0
      compiler/pmodules.pas
  2. 2 0
      compiler/symbase.pas

+ 2 - 0
compiler/pmodules.pas

@@ -947,6 +947,8 @@ type
          { All units are read, now give them a number }
          current_module.updatemaps;
 
+         { further, changing the globalsymtable is not allowed anymore }
+         current_module.globalsymtable.sealed:=true;
          symtablestack.push(current_module.localsymtable);
 
          if not current_module.interface_only then

+ 2 - 0
compiler/symbase.pas

@@ -100,6 +100,8 @@ interface
           tableoptions : tsymtableoptions;
           { level of symtable, used for nested procedures }
           symtablelevel : byte;
+          { do not allow to add new definitions, can be extended to symbols probably }
+          sealed : boolean;
           symtabletype  : TSymtabletype;
           constructor Create(const s:string);
           destructor  destroy;override;