diff --git a/compiler/paramgr.pas b/compiler/paramgr.pas index eb56b066db..a9ed760d60 100644 --- a/compiler/paramgr.pas +++ b/compiler/paramgr.pas @@ -169,6 +169,12 @@ implementation { true if uses a parameter as return value } function tparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean; begin + if (tf_safecall_exceptions in target_info.flags) and + (calloption=pocall_safecall) then + begin + result:=true; + exit; + end; ret_in_param:=((def.typ=arraydef) and not(is_dynamic_array(def))) or (def.typ=recorddef) or (def.typ=stringdef) or diff --git a/compiler/pparautl.pas b/compiler/pparautl.pas index 66baa37254..4331d11967 100644 --- a/compiler/pparautl.pas +++ b/compiler/pparautl.pas @@ -68,7 +68,7 @@ implementation (pd.proccalloption=pocall_safecall)) then paranr:=paranr_result_leftright else -{$elseif defined(x86) or defined(arm)} +{$elseif defined(SUPPORT_SAFECALL)} if (tf_safecall_exceptions in target_info.flags) and (pd.proccalloption = pocall_safecall) then paranr:=paranr_result_leftright diff --git a/compiler/psub.pas b/compiler/psub.pas index 156cd25258..4a1e3c123e 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1172,7 +1172,7 @@ implementation procdef.parast.SymList.ForEachCall(@check_finalize_paras,nil); procdef.localst.SymList.ForEachCall(@check_finalize_locals,nil); -{$if defined(x86) or defined(arm)} +{$ifdef SUPPORT_SAFECALL} { set implicit_finally flag for if procedure is safecall } if (tf_safecall_exceptions in target_info.flags) and (procdef.proccalloption=pocall_safecall) then @@ -1464,7 +1464,7 @@ implementation current_filepos:=entrypos; gen_proc_entry_code(templist); aktproccode.insertlistafter(headertai,templist); -{$if defined(x86) or defined(arm)} +{$ifdef SUPPORT_SAFECALL} { Set return value of safecall procedure if implicit try/finally blocks are disabled } if not (cs_implicit_exceptions in current_settings.moduleswitches) and (tf_safecall_exceptions in target_info.flags) and