aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-22 10:25:22 +0100
committerGitHub <noreply@github.com>2018-11-22 10:25:22 +0100
commita42de742e7c20eeb64699b5785543fea65b2e8d3 (patch)
tree1cb5a0b7e6d6e12846b51dbb51a080a781209ec4 /Python/hamt.c
parentbpo-35059: Cleanup usage of Python macros (GH-10648) (diff)
downloadcpython-a42de742e7c20eeb64699b5785543fea65b2e8d3.tar.gz
cpython-a42de742e7c20eeb64699b5785543fea65b2e8d3.tar.bz2
cpython-a42de742e7c20eeb64699b5785543fea65b2e8d3.zip
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 d734d6ed07f..aa90d37240a 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) {