commit | 2eea952b1b9ebbc2d94fd3faca1536c6b4963725 | [log] [tgz] |
---|---|---|
author | INADA Naoki <methane@users.noreply.github.com> | Mon Sep 04 12:31:09 2017 +0900 |
committer | GitHub <noreply@github.com> | Mon Sep 04 12:31:09 2017 +0900 |
tree | 5262bce350c874f5397b8ad2ca2a6671cb4dd9d6 | |
parent | 7d8282d25d4900dd3367daf28bb393be7f276729 [diff] [blame] |
bpo-31095: fix potential crash during GC (GH-3195) (cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index b78a0fc..212211c 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c
@@ -512,6 +512,8 @@ 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); }