The Wayback Machine - https://web.archive.org/web/20250622002058/https://github.com/python/cpython/pull/12333
Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-36292: Mark unreachable code as such #12333

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

Merged
merged 2 commits into from
Mar 18, 2019

Conversation

stratakis
Copy link
Contributor

@stratakis stratakis commented Mar 14, 2019

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.

You are modiying deadcode, it doesn't deserve a NEWS entry :-)

@@ -4638,6 +4638,8 @@ long_bitwise(PyLongObject *a,
break;
default:
PyErr_BadArgument();
Copy link
Member

Choose a reason for hiding this comment

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

This is deadcode: long_bitwise() is a private function only called with '&', '^' or '|'. So I would prefer to use "Py_UNREACHABLE();" here.

@@ -4666,6 +4668,9 @@ long_bitwise(PyLongObject *a,
break;
default:
PyErr_BadArgument();
Copy link
Member

Choose a reason for hiding this comment

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

Ditto: use "Py_UNREACHABLE();" instead. No need to both with references. It's deadcode.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@stratakis stratakis changed the title bpo-36292: Properly decref operands on failed bitwise operations bpo-36292: Mark unreachable code as such Mar 14, 2019
@terryjreedy
Copy link
Member

The news entry was deleted and Py_UNREACHABLE() used instead. I don't know if our convention is to add the somewhat redundant /* Unreachable code */. Either way, this seems ready to merge.

@@ -4637,8 +4637,8 @@ long_bitwise(PyLongObject *a,
size_z = negb ? size_b : size_a;
break;
default:
PyErr_BadArgument();
return NULL;
/* Unreachable code */
Copy link
Member

Choose a reason for hiding this comment

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

I concur with @terryjreedy: the comment (here and above) is redudant, please remove it.

@vstinner vstinner merged commit a10d426 into python:master Mar 18, 2019
@stratakis stratakis deleted the longobject_master branch January 3, 2020 21: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.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.