[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:
Jelle Zijlstra 2023-11-03 07:02:07 -07:00 committed by GitHub
parent 4db71c3ca7
commit 1a95ad68b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 286 additions and 281 deletions

View file

@ -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)) {