From 2eea952b1b9ebbc2d94fd3faca1536c6b4963725 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Mon, 4 Sep 2017 12:31:09 +0900 Subject: bpo-31095: fix potential crash during GC (GH-3195) (cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c) --- 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 b78a0fc714..212211c5f4 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -512,6 +512,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