From 0fcc03367b31f44c1e1b8d3d2dd940ef1e744326 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Wed, 27 Sep 2017 06:24:16 +0900 Subject: bpo-31095: fix potential crash during GC (GH-2974) (#3196) (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 ad53ba3585..d7586f2de0 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -486,6 +486,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