[Python-checkins] closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)

Benjamin Peterson webhook-mailer at python.org
Wed Feb 21 23:55:21 EST 2018


https://github.com/python/cpython/commit/745dc65b17b3936e3f9f4099f735f174d30c4e0c
commit: 745dc65b17b3936e3f9f4099f735f174d30c4e0c
branch: master
author: Eddie Elizondo <eduardo.elizondorueda at gmail.com>
committer: Benjamin Peterson <benjamin at python.org>
date: 2018-02-21T20:55:18-08:00
summary:

closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)

files:
A Misc/NEWS.d/next/Build/2018-02-21-12-46-00.bpo-32898.M15bZh.rst
M Misc/ACKS
M Objects/listobject.c
M Objects/object.c
M Objects/tupleobject.c

diff --git a/Misc/ACKS b/Misc/ACKS
index b15b20e6c1c0..2eddc56d34d3 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -425,6 +425,7 @@ Tal Einat
 Eric Eisner
 Andrew Eland
 Julien Élie
+Eduardo Elizondo
 Lance Ellinghaus
 Daniel Ellis
 Phil Elson
diff --git a/Misc/NEWS.d/next/Build/2018-02-21-12-46-00.bpo-32898.M15bZh.rst b/Misc/NEWS.d/next/Build/2018-02-21-12-46-00.bpo-32898.M15bZh.rst
new file mode 100644
index 000000000000..4c75466bfd0f
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2018-02-21-12-46-00.bpo-32898.M15bZh.rst
@@ -0,0 +1 @@
+Fix the python debug build when using COUNT_ALLOCS.
diff --git a/Objects/listobject.c b/Objects/listobject.c
index f0fe962be941..c8ffeff09368 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -86,7 +86,7 @@ static void
 show_alloc(void)
 {
     PyInterpreterState *interp = PyThreadState_GET()->interp;
-    if (!inter->core_config.show_alloc_count) {
+    if (!interp->core_config.show_alloc_count) {
         return;
     }
 
diff --git a/Objects/object.c b/Objects/object.c
index fef57fce7ba7..220aa90bf59c 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -97,10 +97,11 @@ void
 dump_counts(FILE* f)
 {
     PyInterpreterState *interp = PyThreadState_GET()->interp;
-    if (!inter->core_config.show_alloc_count) {
+    if (!interp->core_config.show_alloc_count) {
         return;
     }
 
+    PyTypeObject *tp;
     for (tp = type_list; tp; tp = tp->tp_next)
         fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
             "freed: %" PY_FORMAT_SIZE_T "d, "
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 39d43dd04a59..9bb91a5e65a0 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -45,7 +45,7 @@ static void
 show_track(void)
 {
     PyInterpreterState *interp = PyThreadState_GET()->interp;
-    if (!inter->core_config.show_alloc_count) {
+    if (!interp->core_config.show_alloc_count) {
         return;
     }
 



More information about the Python-checkins mailing list