mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-11 08:10:40 +01:00
* fixed handling of static varsyms used for typed constants
* also print staticvarsyms inside localsymtables of procdefs
(used for typed constants and variable initialisers)
git-svn-id: branches/jvmbackend@18473 -
This commit is contained in:
parent
fa841f8011
commit
1c54d3a758
@ -812,8 +812,8 @@ implementation
|
||||
else
|
||||
internalerror(2011011204);
|
||||
end;
|
||||
if (vissym.owner.symtabletype in [staticsymtable,globalsymtable]) or
|
||||
(sp_static in vissym.symoptions) then
|
||||
if (sym.typ=staticvarsym) or
|
||||
(sp_static in sym.symoptions) then
|
||||
result:=result+'static ';
|
||||
result:=result+jvmmangledbasename(sym);
|
||||
end;
|
||||
@ -897,7 +897,7 @@ implementation
|
||||
procedure TJasminAssembler.WriteSymtableVarSyms(st: TSymtable);
|
||||
var
|
||||
sym : tsym;
|
||||
i : longint;
|
||||
i,j : longint;
|
||||
begin
|
||||
if not assigned(st) then
|
||||
exit;
|
||||
@ -909,11 +909,19 @@ implementation
|
||||
fieldvarsym:
|
||||
begin
|
||||
WriteFieldSym(tabstractvarsym(sym));
|
||||
if (sym.typ=staticvarsym) and
|
||||
assigned(tstaticvarsym(sym).defaultconstsym) then
|
||||
WriteFieldSym(tabstractvarsym(tstaticvarsym(sym).defaultconstsym));
|
||||
end;
|
||||
constsym:
|
||||
begin
|
||||
WriteConstSym(tconstsym(sym));
|
||||
end;
|
||||
procsym:
|
||||
begin
|
||||
for j:=0 to tprocsym(sym).procdeflist.count-1 do
|
||||
WriteSymtableVarSyms(tprocdef(tprocsym(sym).procdeflist[j]).localst);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user