bpo-38400 Don't check for NULL linked list pointers in _PyObject_IsFr… · python/cpython@4cdb758 (original) (raw)
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -454,9 +454,12 @@ _PyObject_IsFreed(PyObject *op) | ||
454 | 454 | /* ignore op->ob_ref: its value can have be modified |
455 | 455 | by Py_INCREF() and Py_DECREF(). */ |
456 | 456 | #ifdef Py_TRACE_REFS |
457 | -if (_PyMem_IsPtrFreed(op->_ob_next) | | |
457 | +if (op->_ob_next != NULL && _PyMem_IsPtrFreed(op->_ob_next)) { | |
458 | 458 | return 1; |
459 | 459 | } |
460 | +if (op->_ob_prev != NULL && _PyMem_IsPtrFreed(op->_ob_prev)) { | |
461 | +return 1; | |
462 | + } | |
460 | 463 | #endif |
461 | 464 | return 0; |
462 | 465 | } |