8000 gh-111178: fix UBSan failures in `Modules/_ctypes` by picnixz · Pull Request #129071 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111178: fix UBSan failures in Modules/_ctypes #129071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 21, 2025
Prev Previous commit
Next Next commit
reduce diff even further
  • Loading branch information
picnixz committed Jan 20, 2025
commit a1f7e5ab6f62557a6fdc2915b80c3b77a437f3a0
5 changes: 3 additions & 2 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,11 @@
static void
StructParam_dealloc(PyObject *myself)
{
PyTypeObject *tp = Py_TYPE(myself);
StructParamObject *self = _StructParamObject_CAST(myself);
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(myself);
(void)StructParam_clear(myself);
PyMem_Free(_StructParamObject_CAST(myself)->ptr);
PyMem_Free(self->ptr);
tp->tp_free(myself);
Py_DECREF(tp);
}
Expand Down Expand Up @@ -5762,7 +5763,7 @@
}

static PyType_Slot comerror_slots[] = {
{Py_tp_doc, PyDoc_STR(comerror_doc)},

Check warning on line 5766 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'initializing': different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5766 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (arm64)

'initializing': different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5766 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'initializing': different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5766 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'initializing': different 'const' qualifiers [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]
{Py_tp_init, comerror_init},
{Py_tp_traverse, comerror_traverse},
{Py_tp_dealloc, comerror_dealloc},
Expand Down
Loading
0