-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-123465: Allow Py_RELATIVE_OFFSET for __*offset__ members #123474
Conversation
Thank you, I confirm that this PR fixes the issue I encountered. |
if (strcmp(memb->name, "__weaklistoffset__") == 0) { | ||
weaklistoffset_member = memb; | ||
} | ||
if (strcmp(memb->name, "__dictoffset__") == 0) { | ||
dictoffset_member = memb; | ||
} | ||
if (strcmp(memb->name, "__vectorcalloffset__") == 0) { | ||
vectorcalloffset_member = memb; | ||
} |
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.
I would prefer to use if-else
or continue
. Non-debug builds on MSVC currently avoid a crash here by relying on a default SSA-optimization option (partial redundancy elimination) for some reason, which is usually disabled (/d2ssa-pre-
) to diagnose or work around a crash unlike this.
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.
Adding else
sounds like a great change! continue
would work too.
You could reuse gh-123465 to keep the fix-up commit grouped with this one.
Allow
flags = Py_READONLY | Py_RELATIVE_OFFSET
for the special offset members,which previously required
Py_READONLY
.PyType_FromSpec()
:__vectorcalloffset__
(and other special offset members) does not supportPy_RELATIVE_OFFSET
#123465📚 Documentation preview 📚: https://cpython-previews--123474.org.readthedocs.build/