@@ -7,7 +7,7 @@ typedef PyObject* (*two_arg)(PyObject*, PyObject*);
77typedef PyObject * (* one_arg )(PyObject * );
88typedef PyObject * (* zero_arg )(void );
99
10- #define TRY_RETURN_CALL (ty , args ...) \
10+ #define RETCALL_IF_SIG_MATCHES (ty , args ...) \
1111 if (__builtin_wasm_test_function_pointer_signature((ty)func)) { \
1212 return ((ty)func)(args); \
1313 }
@@ -18,10 +18,10 @@ _PyWasm_TrampolineCall(PyCFunctionWithKeywords func,
1818 PyObject * args ,
1919 PyObject * kw )
2020{
21- TRY_RETURN_CALL (three_arg , self , args , kw );
22- TRY_RETURN_CALL (two_arg , self , args );
23- TRY_RETURN_CALL (one_arg , self );
24- TRY_RETURN_CALL (zero_arg );
21+ RETCALL_IF_SIG_MATCHES (three_arg , self , args , kw );
22+ RETCALL_IF_SIG_MATCHES (two_arg , self , args );
23+ RETCALL_IF_SIG_MATCHES (one_arg , self );
24+ RETCALL_IF_SIG_MATCHES (zero_arg );
2525 PyErr_SetString (PyExc_SystemError , "Handler has incorrect signature" );
2626 return NULL ;
2727}
@@ -37,10 +37,10 @@ _PyWasm_TrampolineCallSetter(setter func,
3737 PyObject * val ,
3838 void * closure )
3939{
40- TRY_RETURN_CALL (setter_three_arg , self , val , closure );
41- TRY_RETURN_CALL (setter_two_arg , self , val );
42- TRY_RETURN_CALL (setter_one_arg , self );
43- TRY_RETURN_CALL (setter_zero_arg );
40+ RETCALL_IF_SIG_MATCHES (setter_three_arg , self , val , closure );
41+ RETCALL_IF_SIG_MATCHES (setter_two_arg , self , val );
42+ RETCALL_IF_SIG_MATCHES (setter_one_arg , self );
43+ RETCALL_IF_SIG_MATCHES (setter_zero_arg );
4444 PyErr_SetString (PyExc_SystemError , "Handler has incorrect signature" );
4545 return -1 ;
4646}
0 commit comments