summaryrefslogtreecommitdiffstats
path: root/Python/hamt.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-22 09:25:22 (GMT)
committerGitHub <noreply@github.com>2018-11-22 09:25:22 (GMT)
commita42de742e7c20eeb64699b5785543fea65b2e8d3 (patch)
tree1cb5a0b7e6d6e12846b51dbb51a080a781209ec4 /Python/hamt.c
parentb37672daf61740fe1ff9d805f6d74bc5ef04012b (diff)
downloadcpython-a42de742e7c20eeb64699b5785543fea65b2e8d3.zip
cpython-a42de742e7c20eeb64699b5785543fea65b2e8d3.tar.gz
cpython-a42de742e7c20eeb64699b5785543fea65b2e8d3.tar.bz2
bpo-35059: Cast void* to PyObject* (GH-10650)
Don't pass void* to Python macros: use _PyObject_CAST().
Diffstat (limited to 'Python/hamt.c')
-rw-r--r--Python/hamt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/hamt.c b/Python/hamt.c
index d734d6e..aa90d37 100644
--- a/Python/hamt.c
+++ b/Python/hamt.c
@@ -373,10 +373,11 @@ hamt_node_collision_count(PyHamtNode_Collision *node);
#ifdef Py_DEBUG
static void
-_hamt_node_array_validate(void *o)
+_hamt_node_array_validate(void *obj_raw)
{
- assert(IS_ARRAY_NODE(o));
- PyHamtNode_Array *node = (PyHamtNode_Array*)(o);
+ PyObject *obj = _PyObject_CAST(obj_raw);
+ assert(IS_ARRAY_NODE(obj));
+ PyHamtNode_Array *node = (PyHamtNode_Array*)obj;
Py_ssize_t i = 0, count = 0;
for (; i < HAMT_ARRAY_NODE_SIZE; i++) {
if (node->a_array[i] != NULL) {