From a6296d34a478b4f697ea9db798146195075d496c Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Thu, 24 Aug 2017 14:55:17 +0900 Subject: bpo-31095: fix potential crash during GC (GH-2974) --- Python/Python-ast.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/Python-ast.c') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 77852f923f..2f1e737ea6 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -520,6 +520,8 @@ typedef struct { static void ast_dealloc(AST_object *self) { + /* bpo-31095: UnTrack is needed before calling any callbacks */ + PyObject_GC_UnTrack(self); Py_CLEAR(self->dict); Py_TYPE(self)->tp_free(self); } -- cgit v1.2.1