Code in profile_trampoline function checks if arg argument value is equal to NULL and in this case assigns Py_None to it
| if (arg==NULL) { |
| arg=Py_None; |
| } |
The only place where
arg is used in
profile_trampoline is this call
| PyObject*result=call_trampoline(tstate, self, frame, what, arg); |
But similar check is already done by
call_trampoline function
| stack[2] = (arg!=NULL) ? arg : Py_None; |
My suggestion is to remove excess check from profile_trampoline.
Linked PRs
Code in
profile_trampolinefunction checks ifargargument value is equal toNULLand in this case assignsPy_Noneto itcpython/Python/sysmodule.c
Lines 954 to 956 in 88a7f66
The only place where
argis used inprofile_trampolineis this callcpython/Python/sysmodule.c
Line 959 in 88a7f66
But similar check is already done by
call_trampolinefunctioncpython/Python/sysmodule.c
Line 930 in 88a7f66
My suggestion is to remove excess check from
profile_trampoline.Linked PRs