Skip to content

Commit b603db2

Browse files
committed
fix broken reference handling in last revert
1 parent b8ad01f commit b603db2

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎Modules/itertoolsmodule.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,9 @@ islice_new_impl(PyTypeObject *type, PyObject *iterable, PyObject *a1,
16381638
/* vectorcall passes borrowed references; hold strong references before
16391639
PyNumber_AsSsize_t() or PyObject_GetIter() can execute arbitrary Python code. */
16401640
Py_XINCREF(iterable);
1641-
Py_XINCREF(start);
1642-
Py_XINCREF(stop);
1643-
Py_XINCREF(step);
1641+
Py_XINCREF(a1);
1642+
Py_XINCREF(a2);
1643+
Py_XINCREF(a3);
16441644

16451645
if (numargs == 2) {
16461646
if (a1 != Py_None) {
@@ -1707,17 +1707,17 @@ islice_new_impl(PyTypeObject *type, PyObject *iterable, PyObject *a1,
17071707
lz->cnt = 0L;
17081708

17091709
Py_DECREF(iterable);
1710-
Py_XDECREF(start);
1711-
Py_XDECREF(stop);
1712-
Py_XDECREF(step);
1710+
Py_XDECREF(a1);
1711+
Py_XDECREF(a2);
1712+
Py_XDECREF(a3);
17131713
return (PyObject *)lz;
17141714

17151715
error:
17161716
Py_XDECREF(it);
17171717
Py_XDECREF(iterable);
1718-
Py_XDECREF(start);
1719-
Py_XDECREF(stop);
1720-
Py_XDECREF(step);
1718+
Py_XDECREF(a1);
1719+
Py_XDECREF(a2);
1720+
Py_XDECREF(a3);
17211721
return NULL;
17221722
}
17231723

0 commit comments

Comments
 (0)