Skip to content
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

bpo-33041: Fix downcast warning on Windows #6595

Merged
merged 1 commit into from
Apr 27, 2018
Merged

bpo-33041: Fix downcast warning on Windows #6595

merged 1 commit into from
Apr 27, 2018

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 25, 2018

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
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?

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

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
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

@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