* explicitly specify symtable to jvm_guarantee_record_typesym() instead of

hardcoding symtablestack.top

git-svn-id: branches/jvmbackend@18585 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:12:43 +00:00
parent 0fad10179c
commit 9d0fdb3150
2 changed files with 8 additions and 9 deletions

View File

@ -1372,7 +1372,7 @@ implementation
{$endif}
read_anon_type(hdef,false);
jvm_guarantee_record_typesym(hdef);
jvm_guarantee_record_typesym(hdef,symtablestack.top);
for i:=0 to sc.count-1 do
begin
vs:=tabstractvarsym(sc[i]);
@ -1587,7 +1587,7 @@ implementation
symtablestack.pop(recst);
end;
read_anon_type(hdef,false);
jvm_guarantee_record_typesym(hdef);
jvm_guarantee_record_typesym(hdef,symtablestack.top);
block_type:=bt_var;
{ allow only static fields reference to struct where they are declared }
if not (vd_class in options) and

View File

@ -27,7 +27,7 @@ unit pjvm;
interface
uses
symtype,symdef;
symtype,symbase,symdef;
{ the JVM specs require that you add a default parameterless
constructor in case the programmer hasn't specified any }
@ -38,7 +38,7 @@ interface
to initialse dynamic arrays }
procedure add_java_default_record_methods_intf(def: trecorddef);
procedure jvm_guarantee_record_typesym(var def: tdef);
procedure jvm_guarantee_record_typesym(var def: tdef; st: tsymtable);
implementation
@ -50,7 +50,7 @@ implementation
fmodule,
parabase,
pdecsub,
symbase,symtable,symconst,symsym,symcreat,defcmp,jvmdef,
symtable,symconst,symsym,symcreat,defcmp,jvmdef,
defutil,paramgr;
@ -118,7 +118,7 @@ implementation
end;
{ determine symtable level }
topowner:=obj;
while not(topowner.owner.symtabletype in [staticsymtable,globalsymtable,localsymtable]) do
while not(topowner.owner.symtabletype in [staticsymtable,globalsymtable]) do
topowner:=topowner.owner.defowner;
{ create procdef }
pd:=tprocdef.create(topowner.owner.symtablelevel+1);
@ -195,7 +195,7 @@ implementation
end;
procedure jvm_guarantee_record_typesym(var def: tdef);
procedure jvm_guarantee_record_typesym(var def: tdef; st: tsymtable);
var
ts: ttypesym;
begin
@ -206,9 +206,8 @@ implementation
not assigned(def.typesym) then
begin
ts:=ttypesym.create(trecorddef(def).symtable.realname^,def);
symtablestack.top.insert(ts);
st.insert(ts);
ts.visibility:=vis_strictprivate;
def.typesym:=ts;
end;
end;