gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (#111655)

This commit is contained in:
AN Long 2023-11-03 12:06:51 +08:00 committed by GitHub
parent 93206d19a3
commit 3a1b09e6d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 6 deletions

View file

@ -2204,10 +2204,8 @@
assert(oparg >= 0 && oparg < _PyFrame_GetCode(frame)->co_nlocalsplus);
name = PyTuple_GET_ITEM(_PyFrame_GetCode(frame)->co_localsplusnames, oparg);
if (PyMapping_GetOptionalItem(class_dict, name, &value) < 0) {
Py_DECREF(class_dict);
GOTO_ERROR(error);
}
Py_DECREF(class_dict);
if (!value) {
PyObject *cell = GETLOCAL(oparg);
value = PyCell_GET(cell);
@ -2217,6 +2215,7 @@
}
Py_INCREF(value);
}
Py_DECREF(class_dict);
stack_pointer[-1] = value;
DISPATCH();
}