Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-103082: Fix shifted field initialization ininstrumentation.c
#103561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-103082: Fix shifted field initialization ininstrumentation.c
#103561
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bedevere-bot commentedApr 15, 2023
🤖 New build scheduled with the buildbot fleet by@arhadthedev for commit286fdc9 🤖 If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
instrumentation.c
instrumentation.c
@markshannon as an author ofgh-103083 this PR fixes. |
@@ -16,14 +16,14 @@ | |||
static PyObject DISABLE = | |||
{ | |||
_PyObject_IMMORTAL_REFCNT, | |||
&PyBaseObject_Type | |||
.ob_refcnt = _PyObject_IMMORTAL_REFCNT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Explicit setting of these fields seems a bit odd to me.
@markshannon should review and merge it since this is recently introduced file.
I think the use of named initializers is fine. Since we can always change it to use macros later, and this fixes compilation, I'm merging this. |
Uh oh!
There was an error while loading.Please reload this page.
If
Py_TRACE_REFS
is defined,PyObject
initializers without field names like:cpython/Python/instrumentation.c
Lines 17 to 21 in2b6f5c3
The reason is implicit insertion of two extra fields under
#ifdef Py_TRACE_REFS
:cpython/Include/object.h
Lines 102 to 106 in2b6f5c3
cpython/Include/object.h
Lines 65 to 76 in2b6f5c3
This commit fixes declarations that fail the(edit: all other places useAMD64 Arch Linux TraceRefs PR
buildbot. Other declarations will be fixed in another, pending PR._PyObject_HEAD_EXTRA
)I desided to not use
_PyObject_HEAD_EXTRA
because it can be forgotten easily (unlike explicit field names) so we should phase it out from CPython codebase if possible.