Sfoglia il codice sorgente

* initialize module id of a symtable always to the id of the current module (at least if there is a current module, which is not the case for the initial macro symtable)

git-svn-id: trunk@35334 -
svenbarth 8 anni fa
parent
commit
969e19ba1a
1 ha cambiato i file con 13 aggiunte e 1 eliminazioni
  1. 13 1
      compiler/symtable.pas

+ 13 - 1
compiler/symtable.pas

@@ -51,6 +51,7 @@ interface
           procedure writedefs(ppufile:tcompilerppufile);
           procedure writedefs(ppufile:tcompilerppufile);
           procedure writesyms(ppufile:tcompilerppufile);
           procedure writesyms(ppufile:tcompilerppufile);
        public
        public
+          constructor create(const s:string);
           procedure insert(sym:TSymEntry;checkdup:boolean=true);override;
           procedure insert(sym:TSymEntry;checkdup:boolean=true);override;
           procedure delete(sym:TSymEntry);override;
           procedure delete(sym:TSymEntry);override;
           { load/write }
           { load/write }
@@ -450,6 +451,18 @@ implementation
                              TStoredSymtable
                              TStoredSymtable
 *****************************************************************************}
 *****************************************************************************}
 
 
+
+    constructor tstoredsymtable.create(const s:string);
+      begin
+        inherited create(s);
+        { Note: this happens for the initial macro symtable, so no error here }
+        if not assigned(current_module) then
+          comment(v_debug,'Current module not available for module id')
+        else
+          moduleid:=current_module.moduleid;
+      end;
+
+
     procedure tstoredsymtable.insert(sym:TSymEntry;checkdup:boolean=true);
     procedure tstoredsymtable.insert(sym:TSymEntry;checkdup:boolean=true);
       begin
       begin
         inherited insert(sym,checkdup);
         inherited insert(sym,checkdup);
@@ -1060,7 +1073,6 @@ implementation
     constructor tabstractrecordsymtable.create(const n:string;usealign,recordminalign,recordmaxCalign:shortint);
     constructor tabstractrecordsymtable.create(const n:string;usealign,recordminalign,recordmaxCalign:shortint);
       begin
       begin
         inherited create(n);
         inherited create(n);
-        moduleid:=current_module.moduleid;
         _datasize:=0;
         _datasize:=0;
         databitsize:=0;
         databitsize:=0;
         recordalignment:=1;
         recordalignment:=1;