* 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,7 +1182,10 @@ implementation
if procdef.parast.symtablelevel>=normal_function_level then if procdef.parast.symtablelevel>=normal_function_level then
symtablestack.push(procdef.parast); symtablestack.push(procdef.parast);
{ insert localsymtable } { 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); symtablestack.push(procdef.localst);
end; end;
@ -1192,6 +1195,7 @@ implementation
_class : tobjectdef; _class : tobjectdef;
begin begin
{ remove localsymtable } { remove localsymtable }
if procdef.localst.symtablelevel>=normal_function_level then
symtablestack.pop(procdef.localst); symtablestack.pop(procdef.localst);
{ remove parasymtable } { remove parasymtable }