Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9776adf

Browse files
committed
rearranged code in debugging version of DELREF to avoid touching data
after it has been freed.
1 parent c6cf1dd commit 9776adf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/object.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,13 @@ UNREF(op)
406406
DELREF(op)
407407
object *op;
408408
{
409+
destructor dealloc = op->ob_type->tp_dealloc;
409410
UNREF(op);
410411
#ifdef COUNT_ALLOCS
411412
op->ob_type->tp_free++;
412413
#endif
413-
(*(op)->ob_type->tp_dealloc)(op);
414414
op->ob_type = NULL;
415+
(*dealloc)(op);
415416
}
416417

417418
printrefs(fp)

0 commit comments

Comments
 (0)