mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.12] gh-116626: Emit CALL
events for all `INSTRUMENTED_CALL_FUNCTION_EX (GH-116732)
Backport of GH-116627
This commit is contained in:
parent
fc4d5fdffe
commit
56a3c5f767
4 changed files with 44 additions and 28 deletions
28
Python/generated_cases.c.h
generated
28
Python/generated_cases.c.h
generated
|
@ -4433,9 +4433,7 @@
|
|||
}
|
||||
assert(PyTuple_CheckExact(callargs));
|
||||
EVAL_CALL_STAT_INC_IF_FUNCTION(EVAL_CALL_FUNCTION_EX, func);
|
||||
if (opcode == INSTRUMENTED_CALL_FUNCTION_EX &&
|
||||
!PyFunction_Check(func) && !PyMethod_Check(func)
|
||||
) {
|
||||
if (opcode == INSTRUMENTED_CALL_FUNCTION_EX) {
|
||||
PyObject *arg = PyTuple_GET_SIZE(callargs) > 0 ?
|
||||
PyTuple_GET_ITEM(callargs, 0) : Py_None;
|
||||
int err = _Py_call_instrumentation_2args(
|
||||
|
@ -4443,17 +4441,19 @@
|
|||
frame, next_instr-1, func, arg);
|
||||
if (err) goto error;
|
||||
result = PyObject_Call(func, callargs, kwargs);
|
||||
if (result == NULL) {
|
||||
_Py_call_instrumentation_exc2(
|
||||
tstate, PY_MONITORING_EVENT_C_RAISE,
|
||||
frame, next_instr-1, func, arg);
|
||||
}
|
||||
else {
|
||||
int err = _Py_call_instrumentation_2args(
|
||||
tstate, PY_MONITORING_EVENT_C_RETURN,
|
||||
frame, next_instr-1, func, arg);
|
||||
if (err < 0) {
|
||||
Py_CLEAR(result);
|
||||
if (!PyFunction_Check(func) && !PyMethod_Check(func)) {
|
||||
if (result == NULL) {
|
||||
_Py_call_instrumentation_exc2(
|
||||
tstate, PY_MONITORING_EVENT_C_RAISE,
|
||||
frame, next_instr-1, func, arg);
|
||||
}
|
||||
else {
|
||||
int err = _Py_call_instrumentation_2args(
|
||||
tstate, PY_MONITORING_EVENT_C_RETURN,
|
||||
frame, next_instr-1, func, arg);
|
||||
if (err < 0) {
|
||||
Py_CLEAR(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue