Skip to content

Commit 06a01eb

Browse files
Address review
1 parent 1b4df92 commit 06a01eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6632,17 +6632,18 @@ dictitems_xor_lock_held(PyObject *d1, PyObject *d2)
66326632
else {
66336633
Py_INCREF(val1);
66346634
to_delete = PyObject_RichCompareBool(val1, val2, Py_EQ);
6635+
Py_CLEAR(val1);
66356636
if (to_delete < 0) {
66366637
goto error;
66376638
}
66386639
}
66396640

66406641
if (to_delete) {
6642+
Py_CLEAR(val2);
66416643
if (_PyDict_DelItem_KnownHash(temp_dict, key, hash) < 0) {
66426644
goto error;
66436645
}
66446646
Py_CLEAR(key);
6645-
Py_CLEAR(val2);
66466647
}
66476648
else {
66486649
PyObject *pair = _PyTuple_FromPairSteal(key, val2);
@@ -6656,7 +6657,6 @@ dictitems_xor_lock_held(PyObject *d1, PyObject *d2)
66566657
}
66576658
Py_DECREF(pair);
66586659
}
6659-
Py_CLEAR(val1);
66606660
}
66616661

66626662
PyObject *remaining_pairs = PyObject_CallMethodNoArgs(

0 commit comments

Comments
 (0)