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
type_new doesn't allocate space for sentinal slot #45578
Comments
type_new() allocates the exact number of slots it's going to use, but |
Can you be more specific as to on which line number the questionable |
typeobject.c:1842:type_new typeobject.c:1966:type_new assigns this just-past-the-end address to type_new later calls PyType_Ready, which calls add_members.
typeobject.c:3062:add_members
for (; memb->name != NULL; memb++) { Interestingly, traverse_slots and clear_slots both use Py_Size rather One possible (if ugly) solution would be to switch iteration methods |
Are you sure you're not missing the +1 on line 440 in PyType_GenericAlloc()? |
Ugh, you're right. I refactored PyType_GenericAlloc out of my fork, which is why I got a crash. Sorry for wasting your time. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: