Переглянути джерело

* put the symtable(s) of the current unit back on the symtablestack before
generating the resource strings, so that the defs generated by the typed
constant builder get added to the correct unit

git-svn-id: branches/hlcgllvm@28761 -

Jonas Maebe 11 роки тому
батько
коміт
12836db931
1 змінених файлів з 8 додано та 1 видалено
  1. 8 1
      compiler/cresstr.pas

+ 8 - 1
compiler/cresstr.pas

@@ -37,7 +37,7 @@ uses
 {$endif}
 {$endif}
    cclasses,widestr,
    cclasses,widestr,
    cutils,globtype,globals,systems,
    cutils,globtype,globals,systems,
-   symconst,symtype,symdef,symsym,
+   symbase,symconst,symtype,symdef,symsym,
    verbose,fmodule,ppu,
    verbose,fmodule,ppu,
    aasmbase,aasmtai,aasmdata,aasmcnst,
    aasmbase,aasmtai,aasmdata,aasmcnst,
    aasmcpu;
    aasmcpu;
@@ -295,6 +295,10 @@ uses
       var
       var
         resstrs : Tresourcestrings;
         resstrs : Tresourcestrings;
       begin
       begin
+        { needed for the typed constant defs that get generated/looked up }
+        if assigned(current_module.globalsymtable) then
+          symtablestack.push(current_module.globalsymtable);
+        symtablestack.push(current_module.localsymtable);
         resstrs:=Tresourcestrings.Create;
         resstrs:=Tresourcestrings.Create;
         resstrs.RegisterResourceStrings;
         resstrs.RegisterResourceStrings;
         if not resstrs.List.Empty then
         if not resstrs.List.Empty then
@@ -304,6 +308,9 @@ uses
             resstrs.WriteRSJFile;
             resstrs.WriteRSJFile;
           end;
           end;
         resstrs.Free;
         resstrs.Free;
+        symtablestack.pop(current_module.localsymtable);
+        if assigned(current_module.globalsymtable) then
+          symtablestack.pop(current_module.globalsymtable);
       end;
       end;
 
 
 end.
 end.