* don't push/pop the unit/program's static symtable on/off the symtable stack

before parsing the main begin/end, because that symtable is already on the
    symtable stack at that point   

git-svn-id: trunk@14233 -
This commit is contained in:
Jonas Maebe 2009-11-21 00:11:39 +00:00
parent 25a3cc09ef
commit 9d5b597105

View File

@ -1182,8 +1182,11 @@ implementation
if procdef.parast.symtablelevel>=normal_function_level then
symtablestack.push(procdef.parast);
{ insert localsymtable }
symtablestack.push(procdef.localst);
{ insert localsymtable, except for the main procedure
(in that case the localst is the unit's static symtable,
which is already on the stack) }
if procdef.localst.symtablelevel>=normal_function_level then
symtablestack.push(procdef.localst);
end;
@ -1192,7 +1195,8 @@ implementation
_class : tobjectdef;
begin
{ remove localsymtable }
symtablestack.pop(procdef.localst);
if procdef.localst.symtablelevel>=normal_function_level then
symtablestack.pop(procdef.localst);
{ remove parasymtable }
if procdef.parast.symtablelevel>=normal_function_level then