Ver código fonte

- removed cdecl from FPC_psabi_begin_catch

git-svn-id: branches/debug_eh@41475 -
florian 6 anos atrás
pai
commit
6b34e511a0
3 arquivos alterados com 4 adições e 9 exclusões
  1. 2 7
      compiler/psabiehpi.pas
  2. 1 1
      rtl/inc/psabieh.inc
  3. 1 1
      rtl/inc/psabiehh.inc

+ 2 - 7
compiler/psabiehpi.pas

@@ -695,6 +695,8 @@ implementation
         paraloc1.init;
         rttidef:=nil;
         rttisym:=nil;
+        wrappedexception:=hlcg.getaddressregister(list,voidpointertype);
+        hlcg.a_load_reg_reg(list,voidpointertype,voidpointertype,NR_FUNCTION_RESULT_REG,wrappedexception);
         if add_catch then
           begin
             if assigned(excepttype) then
@@ -726,17 +728,10 @@ implementation
         else
           (current_procinfo as tpsabiehprocinfo).CurrentAction.AddAction(tobjectdef(-1));
 
-        wrappedexception:=hlcg.getaddressregister(list,voidpointertype);
-
         pd:=search_system_proc('fpc_psabi_begin_catch');
         paramanager.getintparaloc(list, pd, 1, paraloc1);
         hlcg.a_load_reg_cgpara(list,voidpointertype,wrappedexception,paraloc1);
         begincatchres:=hlcg.g_call_system_proc(list,pd,[@paraloc1],nil);
-{$ifdef i386}
-        { fpc_psabi_begin_catch is cdecl, not sure how to do this properly }
-        current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_ADD,S_L,4,NR_ESP));
-{$endif i386}
-
         location_reset(exceptloc, LOC_REGISTER, def_cgsize(begincatchres.def));
         exceptloc.register:=hlcg.getaddressregister(list, begincatchres.def);
         hlcg.gen_load_cgpara_loc(list, begincatchres.def, begincatchres, exceptloc, true);

+ 1 - 1
rtl/inc/psabieh.inc

@@ -1017,7 +1017,7 @@ end;
 function __cxa_begin_catch(exc:PFPC_Unwind_Exception): pointer; cdecl; external;
 {$endif FPC_PSABIEH_CPLUSPLUSSUPPORT}
 
-function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; cdecl; compilerproc;
+function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc;
   var
     ExceptWrapper: PExceptObject;
     _ExceptObjectStack : PExceptObject;

+ 1 - 1
rtl/inc/psabiehh.inc

@@ -78,7 +78,7 @@ function _FPC_psabieh_personality_v0(state: FPC_Unwind_State; libunwind_exceptio
 {$else}
 function _FPC_psabieh_personality_v0(version: longint; actions: FPC_Unwind_Action; exceptionClass: qword; libunwind_exception: PFPC_Unwind_Exception; context: PFPC_Unwind_Context): FPC_Unwind_Reason_Code; cdecl; public;
 {$endif}
-function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; cdecl; compilerproc;
+function FPC_psabi_begin_catch(exc:PFPC_Unwind_Exception): pointer; compilerproc;
 procedure FPC_psabi_end_catch; cdecl; compilerproc;
 {$if defined(cpui386) and not defined(cpullvm)}
 Procedure fpc_Resume(exception_object: PFPC_Unwind_Exception); compilerproc;