]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111178: fix UBSan failures for `RemoteUnwinderObject` (#135539)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sun, 15 Jun 2025 19:00:58 +0000 (21:00 +0200)
committerGitHub <noreply@github.com>
Sun, 15 Jun 2025 19:00:58 +0000 (21:00 +0200)
Modules/_remote_debugging_module.c

index 389889a2cf4c6cbd932088b0cbedf2d00a119efa..c2421cac6bdb173f7049a9205935a7d2334fdbec 100644 (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);