Skip to content

3.12 - PyASCIIObject state only 31 bits in size, should be 32 #99706

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

Closed
davidhewitt opened this issue Nov 22, 2022 · 0 comments
Closed

3.12 - PyASCIIObject state only 31 bits in size, should be 32 #99706

davidhewitt opened this issue Nov 22, 2022 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@davidhewitt
Copy link
Contributor

davidhewitt commented Nov 22, 2022

Looking at

/* Padding to ensure that PyUnicode_DATA() is always aligned to
4 bytes (see issue #19537 on m68k). */
unsigned int :25;

I believe the bitfield is intended to have 32 bits, however summing the fields 1 + 3 + 1 + 1 + 25 = 31.

This only appears to affect 3.12, as the interned field has reduced from 2 bits to 1 bit, and the ready bit has been removed, but the padding was only increased from 24 to 25.

Linked PRs

@davidhewitt davidhewitt added the type-bug An unexpected behavior, bug, or error label Nov 22, 2022
@davidhewitt davidhewitt changed the title 3.12 - PyAsciiObject state only 31 bits in size, should be 32 3.12 - PyASCIIObject state only 31 bits in size, should be 32 Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants