Skip to content

bpo-33041: Fix downcast warning on Windows#6595

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:frame_warn
Apr 27, 2018
Merged

bpo-33041: Fix downcast warning on Windows#6595
vstinner merged 1 commit into
python:masterfrom
vstinner:frame_warn

Conversation

@vstinner

@vstinner vstinner commented Apr 25, 2018

Copy link
Copy Markdown
Member

Cast pointer difference from ssize_t to int: a frame is very unlikely
larger than 2 GB.

https://bugs.python.org/issue33041

Cast pointer difference from ssize_t to int: a frame is very unlikely
larger than 2 GB.
@vstinner

Copy link
Copy Markdown
Member Author

I'm not sure about silently downcasting ssize_t to int. Maybe a check at runtime would be safer, but I'm too lazy to write complex code to handle errors :-) What do you think @serhiy-storchaka? Is it ok to rely that a stack will not be larger than 2 GB?

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it is safe. This difference should be limited by co_stacksize which has type int.

@vstinner

Copy link
Copy Markdown
Member Author

I think it is safe. This difference should be limited by co_stacksize which has type int.

Oh right. Thanks for checking!

@vstinner vstinner merged commit 078c4e3 into python:master Apr 27, 2018
@bedevere-bot

Copy link
Copy Markdown

@vstinner: Please replace # with GH- in the commit message next time. Thanks!

@vstinner vstinner deleted the frame_warn branch April 27, 2018 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants