Skip to content

[3.11] gh-99845: _PyObject_DictPointer(): fix dictoffset cast - #99922

Merged
vstinner merged 1 commit into
python:3.11from
vstinner:obj_dictptr311
Dec 1, 2022
Merged

[3.11] gh-99845: _PyObject_DictPointer(): fix dictoffset cast#99922
vstinner merged 1 commit into
python:3.11from
vstinner:obj_dictptr311

Conversation

@vstinner

@vstinnervstinner commented Dec 1, 2022

Copy link
Copy Markdown
Member

Cast size_t to Py_ssize_t, rather than casting it to long. On 64-bit Windows, long is 32-bit whereas Py_ssize_t is 64-bit.

Cast size_t to Py_ssize_t, rather than casting it to long. On 64-bit
Windows, long is 32-bit whereas Py_ssize_t is 64-bit.
@vstinner

Copy link
Copy Markdown
MemberAuthor

@serhiy-storchaka: I don't think that it deserves a NEWS entry, since it's unlikely that dictoffset is larger than LONG_MAX (2^31-1 on 64-bit Windows).

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@vstinner
vstinner deleted the obj_dictptr311 branch December 1, 2022 13:08
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 1, 2022
…H-99922)
Cast size_t to Py_ssize_t, rather than casting it to long. On 64-bit
Windows, long is 32-bit whereas Py_ssize_t is 64-bit.
(cherry picked from commit 9707bf2)
Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-bot

Copy link
Copy Markdown

GH-99924 is a backport of this pull request to the 3.10 branch.

@vstinner

Copy link
Copy Markdown
MemberAuthor

@serhiy-storchaka: Merged, thanks for the review.

@bedevere-botbedevere-bot removed the needs backport to 3.10 only security fixes label Dec 1, 2022
miss-islington added a commit that referenced this pull request Dec 1, 2022
Cast size_t to Py_ssize_t, rather than casting it to long. On 64-bit
Windows, long is 32-bit whereas Py_ssize_t is 64-bit.
(cherry picked from commit 9707bf2)
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@vstinner@miss-islington@bedevere-bot@serhiy-storchaka