mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
GH-113486: Do not emit spurious PY_UNWIND events for optimized calls to classes. (GH-113680)
This commit is contained in:
parent
ed6ea3ea79
commit
0ae60b66de
6 changed files with 64 additions and 28 deletions
|
|
@ -1576,13 +1576,11 @@ _Py_Instrument(PyCodeObject *code, PyInterpreterState *interp)
|
|||
}
|
||||
_Py_Executors_InvalidateDependency(interp, code);
|
||||
int code_len = (int)Py_SIZE(code);
|
||||
/* code->_co_firsttraceable >= code_len indicates
|
||||
* that no instrumentation can be inserted.
|
||||
* Exit early to avoid creating instrumentation
|
||||
/* Exit early to avoid creating instrumentation
|
||||
* data for potential statically allocated code
|
||||
* objects.
|
||||
* See https://github.com/python/cpython/issues/108390 */
|
||||
if (code->_co_firsttraceable >= code_len) {
|
||||
if (code->co_flags & CO_NO_MONITORING_EVENTS) {
|
||||
return 0;
|
||||
}
|
||||
if (update_instrumentation_data(code, interp)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue