mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
[3.12] gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (GH-111655) (#111674)
(cherry picked from commit 3a1b09e6d0
)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
This commit is contained in:
parent
4db71c3ca7
commit
1a95ad68b4
4 changed files with 286 additions and 281 deletions
|
@ -1425,7 +1425,6 @@ dummy_func(
|
|||
Py_INCREF(value);
|
||||
}
|
||||
else if (_PyErr_Occurred(tstate)) {
|
||||
Py_DECREF(class_dict);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -1433,13 +1432,11 @@ dummy_func(
|
|||
value = PyObject_GetItem(class_dict, name);
|
||||
if (value == NULL) {
|
||||
if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
|
||||
Py_DECREF(class_dict);
|
||||
goto error;
|
||||
}
|
||||
_PyErr_Clear(tstate);
|
||||
}
|
||||
}
|
||||
Py_DECREF(class_dict);
|
||||
if (!value) {
|
||||
PyObject *cell = GETLOCAL(oparg);
|
||||
value = PyCell_GET(cell);
|
||||
|
@ -1449,6 +1446,7 @@ dummy_func(
|
|||
}
|
||||
Py_INCREF(value);
|
||||
}
|
||||
Py_DECREF(class_dict);
|
||||
}
|
||||
|
||||
inst(LOAD_DEREF, ( -- value)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue