gh-123465: Allow Py_RELATIVE_OFFSET for __*offset__ members#123474
Merged
encukou merged 3 commits intopython:mainfrom Sep 5, 2024
Merged
gh-123465: Allow Py_RELATIVE_OFFSET for __*offset__ members#123474encukou merged 3 commits intopython:mainfrom
encukou merged 3 commits intopython:mainfrom
Conversation
Contributor
|
Thank you, I confirm that this PR fixes the issue I encountered. |
neonene
reviewed
Oct 12, 2024
Comment on lines
+4740
to
+4748
| 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; | ||
| } |
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow
flags = Py_READONLY | Py_RELATIVE_OFFSETfor 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/