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

git-svn-id: trunk@19523 -
This commit is contained in:
paul 2011-10-21 06:09:24 +00:00
parent 5d7d143300
commit 110119e398

View File

@ -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