Skip to content

Commit 414fc25

Browse files
picnixzmiss-islington
authored andcommitted
pythongh-111178: fix UBSan failures for RemoteUnwinderObject (pythonGH-135539)
(cherry picked from commit 54e29ea) Co-authored-by: Bénédikt Tran <[email protected]>
1 parent e00aef6 commit 414fc25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/_remote_debugging_module.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ typedef struct {
212212
#endif
213213
} RemoteUnwinderObject;
214214

215+
#define RemoteUnwinder_CAST(op) ((RemoteUnwinderObject *)(op))
216+
215217
typedef struct
216218
{
217219
int lineno;
@@ -2899,8 +2901,9 @@ static PyMethodDef RemoteUnwinder_methods[] = {
28992901
};
29002902

29012903
static void
2902-
RemoteUnwinder_dealloc(RemoteUnwinderObject *self)
2904+
RemoteUnwinder_dealloc(PyObject *op)
29032905
{
2906+
RemoteUnwinderObject *self = RemoteUnwinder_CAST(op);
29042907
PyTypeObject *tp = Py_TYPE(self);
29052908
if (self->code_object_cache) {
29062909
_Py_hashtable_destroy(self->code_object_cache);

0 commit comments

Comments
 (0)