* made push_addr_param() ABI-compliant

git-svn-id: trunk@29859 -
This commit is contained in:
Jonas Maebe 2015-02-23 22:49:46 +00:00
parent e2c30eb0a1
commit 232599b429

View File

@ -208,7 +208,7 @@ unit cpupara;
end; end;
function taarch64paramanager.push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean; function taarch64paramanager.push_addr_param(varspez: tvarspez; def :tdef; calloption: tproccalloption): boolean;
var var
hfabasedef: tdef; hfabasedef: tdef;
begin begin
@ -220,19 +220,34 @@ unit cpupara;
end; end;
case def.typ of case def.typ of
objectdef: objectdef:
result:=not(Is_HFA(def,hfabasedef) and (is_object(def) and ((varspez=vs_const) or (def.size=0)))); result:=
is_object(def) and
not is_hfa(def,hfabasedef) and
(def.size>16);
recorddef: recorddef:
{ note: should this ever be changed, make sure that const records { ABI: any composite > 16 bytes that not a hfa/hva
are always passed by reference for calloption=pocall_mwpascal } Special case: MWPascal, which passes all const parameters by
result:=(varspez=vs_const) or (def.size=0); reference for compatibility reasons
}
result:=
((varspez=vs_const) and
(calloption=pocall_mwpascal)) or
(not is_hfa(def,hfabasedef) and
(def.size>16));
variantdef, variantdef,
formaldef: formaldef:
result:=true; result:=true;
{ arrays are composites and hence treated the same as records by the
ABI (watch out for C, where an array is a pointer) }
arraydef: arraydef:
result:=(tarraydef(def).highrange>=tarraydef(def).lowrange) or result:=
(calloption in cdecl_pocalls) or
is_open_array(def) or is_open_array(def) or
is_array_of_const(def) or is_array_of_const(def) or
is_array_constructor(def); is_array_constructor(def) or
((tarraydef(def).highrange>=tarraydef(def).lowrange) and
not is_hfa(def,hfabasedef) and
(def.size>16));
setdef : setdef :
result:=def.size>16; result:=def.size>16;
stringdef : stringdef :