cpython: 030205f1e716 (original) (raw)
--- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -1030,8 +1030,7 @@ odict_reduce(register PyODictObject od) goto Done; if (!ns_len) { / nothing novel to pickle in od.dict */
Py_DECREF(ns);[](#l1.7)
ns = NULL;[](#l1.8)
} @@ -1184,8 +1183,7 @@ static PyObject * value = PyObject_GetItem(od, key); if (value != NULL) { if (PyObject_DelItem(od, key) == -1) {Py_CLEAR(ns);[](#l1.9) }[](#l1.10)
Py_DECREF(value);[](#l1.17)
value = NULL;[](#l1.18)
Py_CLEAR(value);[](#l1.19) }[](#l1.20) }[](#l1.21) }[](#l1.22)
@@ -1718,10 +1716,10 @@ odict_new(PyTypeObject *type, PyObject * { PyObject *od = PyDict_Type.tp_new(type, args, kwds); if (od != NULL) {
if (_odict_initialize((PyODictObject *)od) < 0)[](#l1.27)
return NULL;[](#l1.28) ((PyODictObject *)od)->od_inst_dict = PyDict_New();[](#l1.29) ((PyODictObject *)od)->od_weakreflist = NULL;[](#l1.30)
if (_odict_initialize((PyODictObject *)od) < 0)[](#l1.31)
} return od; } @@ -1845,8 +1843,7 @@ odictiter_nextkey(odictiterobject di) node = _odict_find_node(di->di_odict, di->di_current); if (node == NULL) { / Must have been deleted. */return NULL;[](#l1.32)
Py_DECREF(di->di_current);[](#l1.40)
di->di_current = NULL;[](#l1.41)
} key = di->di_current; @@ -1884,8 +1881,11 @@ odictiter_iternext(odictiterobject *di) PyObject *result = di->di_result;Py_CLEAR(di->di_current);[](#l1.42) return NULL;[](#l1.43)
value = PyODict_GetItem((PyObject )di->di_odict, key); / borrowed */
if (value == NULL)[](#l1.50)
if (value == NULL) {[](#l1.51)
Py_DECREF(key);[](#l1.52) return NULL;[](#l1.53)
}[](#l1.54)
Py_INCREF(value);[](#l1.55)
if (result->ob_refcnt == 1) { /* not in use so we can reuse it @@ -1896,11 +1896,13 @@ odictiter_iternext(odictiterobject *di) } else { result = PyTuple_New(2);
if (result == NULL)[](#l1.63)
if (result == NULL) {[](#l1.64)
Py_DECREF(key);[](#l1.65)
Py_DECREF(value);[](#l1.66) return NULL;[](#l1.67)
}[](#l1.68) }[](#l1.69)
Py_INCREF(value);[](#l1.71) PyTuple_SET_ITEM(result, 0, key); /* steals reference */[](#l1.72) PyTuple_SET_ITEM(result, 1, value); /* steals reference */[](#l1.73)
@@ -2365,7 +2367,6 @@ mutablemapping_update(PyObject self, Py else if (PyObject_HasAttrString(other, "keys")) { / never fails */ PyObject *keys, *iterator, *key; keys = PyObject_CallMethod(other, "keys", NULL);
Py_DECREF(other);[](#l1.79) if (keys == NULL)[](#l1.80) return NULL;[](#l1.81) iterator = PyObject_GetIter(keys);[](#l1.82)
@@ -2383,6 +2384,7 @@ mutablemapping_update(PyObject *self, Py } Py_DECREF(key); }
Py_DECREF(other);[](#l1.87) Py_DECREF(iterator);[](#l1.88) if (res != 0 || PyErr_Occurred())[](#l1.89) return NULL;[](#l1.90)