mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-111178: fix UBSan failures in Modules/_interp*module.c
(GH-129779)
Fix UBSan failures for `XIBufferViewObject` Remove redundant casts, suppress unused return values
This commit is contained in:
parent
7ea8927ec7
commit
6669905723
3 changed files with 52 additions and 44 deletions
|
@ -1934,7 +1934,7 @@ static int
|
|||
module_traverse(PyObject *mod, visitproc visit, void *arg)
|
||||
{
|
||||
module_state *state = get_module_state(mod);
|
||||
traverse_module_state(state, visit, arg);
|
||||
(void)traverse_module_state(state, visit, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1944,17 +1944,17 @@ module_clear(PyObject *mod)
|
|||
module_state *state = get_module_state(mod);
|
||||
|
||||
// Now we clear the module state.
|
||||
clear_module_state(state);
|
||||
(void)clear_module_state(state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
module_free(void *mod)
|
||||
{
|
||||
module_state *state = get_module_state(mod);
|
||||
module_state *state = get_module_state((PyObject *)mod);
|
||||
|
||||
// Now we clear the module state.
|
||||
clear_module_state(state);
|
||||
(void)clear_module_state(state);
|
||||
|
||||
_globals_fini();
|
||||
}
|
||||
|
@ -1968,7 +1968,7 @@ static struct PyModuleDef moduledef = {
|
|||
.m_slots = module_slots,
|
||||
.m_traverse = module_traverse,
|
||||
.m_clear = module_clear,
|
||||
.m_free = (freefunc)module_free,
|
||||
.m_free = module_free,
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue