]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-123484: Fix the debug offsets for PyLongObject (#123485)
authorMatt Wozniski <mwozniski@bloomberg.net>
Fri, 30 Aug 2024 11:39:28 +0000 (07:39 -0400)
committerGitHub <noreply@github.com>
Fri, 30 Aug 2024 11:39:28 +0000 (12:39 +0100)
Include/internal/pycore_runtime_init.h
Misc/NEWS.d/next/Core_and_Builtins/2024-08-29-19-46-07.gh-issue-123484.rjUn_F.rst [new file with mode: 0644]

index 1746bbf0eec8b554765c8a5857ff22e01ea1d7ae..e6adb98eb1913095516eea8a694e81a463b2f074 100644 (file)
@@ -117,8 +117,8 @@ extern PyTypeObject _PyExc_MemoryError;
             }, \
             .long_object = { \
                 .size = sizeof(PyLongObject), \
-                .lv_tag = offsetof(_PyLongValue, lv_tag), \
-                .ob_digit = offsetof(_PyLongValue, ob_digit), \
+                .lv_tag = offsetof(PyLongObject, long_value.lv_tag), \
+                .ob_digit = offsetof(PyLongObject, long_value.ob_digit), \
             }, \
             .bytes_object = { \
                 .size = sizeof(PyBytesObject), \
diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-08-29-19-46-07.gh-issue-123484.rjUn_F.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-08-29-19-46-07.gh-issue-123484.rjUn_F.rst
new file mode 100644 (file)
index 0000000..3062e36
--- /dev/null
@@ -0,0 +1,2 @@
+Fix ``_Py_DebugOffsets`` for long objects to be relative to the start of the
+object rather than the start of a subobject.