bpo-35961: Fix a crash in slice_richcompare() by vstinner · Pull Request #11830 · python/cpython

@vstinner

Fix a crash in slice_richcompare(): use strong references rather than
borrowed references for the two temporary internal tuples.

The crash (or assertion error) occurred if a garbage collection
occurred during slice_richcompare(), especially while calling
PyObject_RichCompare(t1, t2, op).

tim-one

@vstinner

methane

pablogsal

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Feb 13, 2019
Fix a crash in slice_richcompare(): use strong references rather than
stolen references for the two temporary internal tuples.

The crash (or assertion error) occurred if a garbage collection
occurred during slice_richcompare(), especially while calling
PyObject_RichCompare(t1, t2, op).
(cherry picked from commit dcb68f4)

Co-authored-by: Victor Stinner <vstinner@redhat.com>

miss-islington added a commit that referenced this pull request

Feb 13, 2019
Fix a crash in slice_richcompare(): use strong references rather than
stolen references for the two temporary internal tuples.

The crash (or assertion error) occurred if a garbage collection
occurred during slice_richcompare(), especially while calling
PyObject_RichCompare(t1, t2, op).
(cherry picked from commit dcb68f4)

Co-authored-by: Victor Stinner <vstinner@redhat.com>