gh-111178: fix UBSan failures in `Modules/_randommodule.c` by picnixz · Pull Request #129791 · python/cpython
#define RandomObject_CAST(op) ((RandomObject *)(op))
#include "clinic/_randommodule.c.h"
static int random_init(RandomObject *self, PyObject *args, PyObject *kwds) random_init(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *arg = NULL; _randomstate *state = _randomstate_type(Py_TYPE(self));
return random_seed(self, arg); return random_seed(RandomObject_CAST(self), arg); }
static struct PyModuleDef _randommodule = {