aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-08-24 14:55:17 +0900
committerGitHub <noreply@github.com>2017-08-24 14:55:17 +0900
commita6296d34a478b4f697ea9db798146195075d496c (patch)
tree6a26d56297f7d85dd6a8f18bca96e0c4ffb60802 /Parser/asdl_c.py
parentbpo-31229: Fixed wrong error messages when too many keyword arguments are rec... (diff)
downloadcpython-a6296d34a478b4f697ea9db798146195075d496c.tar.gz
cpython-a6296d34a478b4f697ea9db798146195075d496c.tar.bz2
cpython-a6296d34a478b4f697ea9db798146195075d496c.zip
bpo-31095: fix potential crash during GC (GH-2974)
Diffstat (limited to 'Parser/asdl_c.py')
-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 b367e10231c..f6c3a661172 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -633,6 +633,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);
}