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

Skip to content

gh-111178: fix UBSan failures in Modules/selectmodule.c #129792

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
Feb 24, 2025
Merged
Prev Previous commit
Next Next commit
fix compilation
  • Loading branch information
picnixz committed Feb 7, 2025
commit 6f30e5597e2e52bfbd25ca4ded4b7adfd05a37c2
3 changes: 1 addition & 2 deletions Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1938,13 +1938,12 @@ static PyObject *
kqueue_event_richcompare(PyObject *lhs, PyObject *rhs, int op)
{
int result;
kqueue_event_Object *s = kqueue_event_Object_CAST(lhs);
_selectstate *state = _selectstate_by_type(Py_TYPE(s));

if (!kqueue_event_Check(o, state)) {
Py_RETURN_NOTIMPLEMENTED;
}

kqueue_event_Object *s = kqueue_event_Object_CAST(lhs);
kqueue_event_Object *o = (kqueue_event_Object *)rhs; // fast cast

#define CMP(a, b) ((a) != (b)) ? ((a) < (b) ? -1 : 1)
Expand Down
0