gh-111178: fix UBSan failures for RemoteUnwinderObject (#135539)

This commit is contained in:
Bénédikt Tran 2025-06-15 21:00:58 +02:00 committed by GitHub
parent 076f87468a
commit 54e29ea4eb
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);