summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-09-04 03:31:09 (GMT)
committerGitHub <noreply@github.com>2017-09-04 03:31:09 (GMT)
commit2eea952b1b9ebbc2d94fd3faca1536c6b4963725 (patch)
tree5262bce350c874f5397b8ad2ca2a6671cb4dd9d6 /Parser
parent7d8282d25d4900dd3367daf28bb393be7f276729 (diff)
downloadcpython-2eea952b1b9ebbc2d94fd3faca1536c6b4963725.zip
cpython-2eea952b1b9ebbc2d94fd3faca1536c6b4963725.tar.gz
cpython-2eea952b1b9ebbc2d94fd3faca1536c6b4963725.tar.bz2
bpo-31095: fix potential crash during GC (GH-3195)
(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/asdl_c.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 13124bb..1e5f4d9 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -630,6 +630,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);
}