Browse Source

* also number units for program

peter 26 years ago
parent
commit
4807c96d29
2 changed files with 16 additions and 4 deletions
  1. 8 2
      compiler/pmodules.pas
  2. 8 2
      compiler/symtable.pas

+ 8 - 2
compiler/pmodules.pas

@@ -1238,9 +1238,12 @@ unit pmodules;
          if token=_USES then
            loadunits;
 
-
+         { reset ranges/stabs in exported definitions }
          reset_global_defs;
 
+         { All units are read, now give them a number }
+         numberunits;
+
          {Insert the name of the main program into the symbol table.}
          if current_module^.modulename^<>'' then
            {st^.insert(new(pprogramsym,init(current_module^.modulename^)));}
@@ -1349,7 +1352,10 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.132  1999-07-23 11:37:48  peter
+  Revision 1.133  1999-07-24 00:13:25  peter
+    * also number units for program
+
+  Revision 1.132  1999/07/23 11:37:48  peter
     * error for illegal type reference, instead of 10998
 
   Revision 1.131  1999/07/22 09:37:54  florian

+ 8 - 2
compiler/symtable.pas

@@ -526,9 +526,12 @@ implementation
              psymtable(hp1^.globalsymtable)^.unitid:=-1;
            hp1:=pmodule(hp1^.next);
          end;
+        { Our own symtable gets unitid 0, for a program there is
+          no globalsymtable }
+        if assigned(current_module^.globalsymtable) then
+          psymtable(current_module^.globalsymtable)^.unitid:=0;
         { number units }
         counter:=1;
-        psymtable(current_module^.globalsymtable)^.unitid:=0;
         hp:=pused_unit(current_module^.used_units.first);
         while assigned(hp) do
          begin
@@ -2338,7 +2341,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.29  1999-07-23 16:05:33  peter
+  Revision 1.30  1999-07-24 00:13:26  peter
+    * also number units for program
+
+  Revision 1.29  1999/07/23 16:05:33  peter
     * alignment is now saved in the symtable
     * C alignment added for records
     * PPU version increased to solve .12 <-> .13 probs