[3.14] gh-111178: fix UBSan failures for RemoteUnwinderObject (GH-135539) (#135547)

This commit is contained in:
Miss Islington (bot) 2025-06-15 22:54:23 +02:00 committed by GitHub
parent 1c4f01a160
commit e89c7f1fc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -214,6 +214,8 @@ typedef struct {
#endif
} RemoteUnwinderObject;
#define RemoteUnwinder_CAST(op) ((RemoteUnwinderObject *)(op))
typedef struct
{
int lineno;
@ -2913,8 +2915,9 @@ static PyMethodDef RemoteUnwinder_methods[] = {
};
static void
RemoteUnwinder_dealloc(RemoteUnwinderObject *self)
RemoteUnwinder_dealloc(PyObject *op)
{
RemoteUnwinderObject *self = RemoteUnwinder_CAST(op);
PyTypeObject *tp = Py_TYPE(self);
if (self->code_object_cache) {
_Py_hashtable_destroy(self->code_object_cache);