Skip to content

Commit 184841a

Browse files
committed
Update _PyObject_GC_UNTRACK
1 parent 561e2d5 commit 184841a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Include/objimpl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,10 @@ extern PyGC_Head *_PyGC_generation0;
303303
*/
304304
#define _PyObject_GC_UNTRACK(o) do { \
305305
PyGC_Head *g = _Py_AS_GC(o); \
306+
PyGC_Head *prev = _PyGCHead_PREV(g); \
306307
assert(g->gc.gc_next != NULL); \
307-
_PyGCHead_PREV(g)->gc.gc_next = g->gc.gc_next; \
308-
_PyGCHead_SET_PREV(g->gc.gc_next, _PyGCHead_PREV(g)); \
308+
prev->gc.gc_next = g->gc.gc_next; \
309+
_PyGCHead_SET_PREV(g->gc.gc_next, prev); \
309310
g->gc.gc_next = NULL; \
310311
g->gc.gc_prev &= _PyGC_PREV_MASK_FINALIZED; \
311312
} while (0);

0 commit comments

Comments
 (0)