* correct parameter encoding of formaldef (add array type for formal const,

remove double array type for formal var/out)

git-svn-id: branches/jvmbackend@18551 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:09:40 +00:00
parent 2ed430de8c
commit d7e78b9f95
2 changed files with 11 additions and 12 deletions

View File

@ -303,8 +303,7 @@ implementation
formaldef : formaldef :
begin begin
{$ifndef nounsupported} {$ifndef nounsupported}
{ var x: JLObject } { var/const/out x: JLObject }
encodedstr:=encodedstr+'[';
result:=jvmaddencodedtype(java_jlobject,false,encodedstr,forcesignature,founderror); result:=jvmaddencodedtype(java_jlobject,false,encodedstr,forcesignature,founderror);
{$else} {$else}
result:=false; result:=false;

View File

@ -4492,16 +4492,16 @@ implementation
name } name }
if ([vo_is_funcret,vo_is_self] * vs.varoptions <> []) then if ([vo_is_funcret,vo_is_self] * vs.varoptions <> []) then
continue; continue;
{ reference parameters are not yet supported }
if (vs.varspez in [vs_var,vs_out,vs_constref]) then
begin
{ passing by reference is emulated by passing an array of one { passing by reference is emulated by passing an array of one
element containing the value; for types that aren't pointers element containing the value; for types that aren't pointers
in regular Pascal, simply passing the underlying pointer type in regular Pascal, simply passing the underlying pointer type
does achieve regular call-by-reference semantics though } does achieve regular call-by-reference semantics though;
if not jvmimplicitpointertype(vs.vardef) then formaldefs always have to be passed like that because their
contents can be replaced }
if (vs.vardef.typ=formaldef) or
((vs.varspez in [vs_var,vs_out,vs_constref]) and
not jvmimplicitpointertype(vs.vardef)) then
tmpresult:=tmpresult+'['; tmpresult:=tmpresult+'[';
end;
{ Add the parameter type. } { Add the parameter type. }
if not jvmaddencodedtype(vs.vardef,false,tmpresult,signature,founderror) then if not jvmaddencodedtype(vs.vardef,false,tmpresult,signature,founderror) then
{ should be checked earlier on } { should be checked earlier on }