Skip to content

Commit 54e29ea

Browse files
authored
gh-111178: fix UBSan failures for RemoteUnwinderObject (#135539)
1 parent 076f874 commit 54e29ea

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
@@ -214,6 +214,8 @@ typedef struct {
214214
#endif
215215
} RemoteUnwinderObject;
216216

217+
#define RemoteUnwinder_CAST(op) ((RemoteUnwinderObject *)(op))
218+
217219
typedef struct
218220
{
219221
int lineno;
@@ -2913,8 +2915,9 @@ static PyMethodDef RemoteUnwinder_methods[] = {
29132915
};
29142916

29152917
static void
2916-
RemoteUnwinder_dealloc(RemoteUnwinderObject *self)
2918+
RemoteUnwinder_dealloc(PyObject *op)
29172919
{
2920+
RemoteUnwinderObject *self = RemoteUnwinder_CAST(op);
29182921
PyTypeObject *tp = Py_TYPE(self);
29192922
if (self->code_object_cache) {
29202923
_Py_hashtable_destroy(self->code_object_cache);

0 commit comments

Comments
 (0)