Skip to content

Conversation

skirpichev
Copy link
Contributor

@skirpichev skirpichev commented Oct 10, 2024

memcopy'ing arbitrary values to _Bool variable triggers undefined behaviour. Avoid this.
We assume that false is represented by all zero bytes.

Credits to Alex Gaynor.

(cherry picked from commit 87d7315)

…truct module (pythonGH-125169)

memcopy'ing arbitrary values to _Bool variable triggers undefined
behaviour. Avoid this.
We assume that `false` is represented by all zero bytes.

Credits to Alex Gaynor.

(cherry picked from commit 87d7315)

Co-authored-by: Sergey B Kirpichev <[email protected]>
Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner vstinner enabled auto-merge (squash) October 10, 2024 14:53
@vstinner vstinner merged commit 67f8302 into python:3.12 Oct 10, 2024
31 checks passed
@skirpichev skirpichev deleted the backport-87d7315-3.12 branch October 10, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants