Просмотр исходного кода

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

git-svn-id: trunk@29811 -
florian 10 лет назад
Родитель
Сommit
a5bef2a2b9
2 измененных файлов с 4 добавлено и 0 удалено
  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 }
          { All units are read, now give them a number }
          current_module.updatemaps;
          current_module.updatemaps;
 
 
+         { further, changing the globalsymtable is not allowed anymore }
+         current_module.globalsymtable.sealed:=true;
          symtablestack.push(current_module.localsymtable);
          symtablestack.push(current_module.localsymtable);
 
 
          if not current_module.interface_only then
          if not current_module.interface_only then

+ 2 - 0
compiler/symbase.pas

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