Explorar el Código

compiler: use globalsymtable for units to store ansistring replacement def (fixes bug #0020529)

git-svn-id: trunk@19523 -
paul hace 13 años
padre
commit
110119e398
Se han modificado 1 ficheros con 8 adiciones y 2 borrados
  1. 8 2
      compiler/symdef.pas

+ 8 - 2
compiler/symdef.pas

@@ -861,6 +861,8 @@ implementation
       end;
 
     function getansistringdef:tstringdef; inline;
+      var
+        symtable:tsymtable;
       begin
         { if codepage is explicitly defined in this mudule we need to return
           a replacement for ansistring def }
@@ -873,9 +875,13 @@ implementation
             if not assigned(current_module.ansistrdef) then
               begin
                 { if we did not create it yet we need to do this now }
-                symtablestack.push(current_module.localsymtable);
+                if current_module.is_unit then
+                  symtable:=current_module.globalsymtable
+                else
+                  symtable:=current_module.localsymtable;
+                symtablestack.push(symtable);
                 current_module.ansistrdef:=tstringdef.createansi(current_settings.sourcecodepage);
-                symtablestack.pop(current_module.localsymtable);
+                symtablestack.pop(symtable);
               end;
             result:=tstringdef(current_module.ansistrdef);
           end