]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-111178: fix UBSan failures for `RemoteUnwinderObject` (GH-135539) (#135547)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 15 Jun 2025 20:54:23 +0000 (22:54 +0200)
committerGitHub <noreply@github.com>
Sun, 15 Jun 2025 20:54:23 +0000 (22:54 +0200)
Modules/_remote_debugging_module.c

index 564eaef621db672be5f3247f02eda3e5f1c6d362..416298d7479df36b15354a6a176265aa4d24ac45 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);