[Python-checkins] bpo-36292: Mark unreachable code as such in long bitwise ops (GH-12333)

Victor Stinner webhook-mailer at python.org
Mon Mar 18 13:59:35 EDT 2019


https://github.com/python/cpython/commit/a10d426bab66a4e1f20d5e1b9aee3dbb435cf309
commit: a10d426bab66a4e1f20d5e1b9aee3dbb435cf309
branch: master
author: stratakis <cstratak at redhat.com>
committer: Victor Stinner <vstinner at redhat.com>
date: 2019-03-18T18:59:20+01:00
summary:

bpo-36292:  Mark unreachable code as such in long bitwise ops (GH-12333)

files:
M Objects/longobject.c

diff --git a/Objects/longobject.c b/Objects/longobject.c
index 1e3445c64a6a..da697a784faa 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -4637,8 +4637,7 @@ long_bitwise(PyLongObject *a,
         size_z = negb ? size_b : size_a;
         break;
     default:
-        PyErr_BadArgument();
-        return NULL;
+        Py_UNREACHABLE();
     }
 
     /* We allow an extra digit if z is negative, to make sure that
@@ -4665,8 +4664,7 @@ long_bitwise(PyLongObject *a,
             z->ob_digit[i] = a->ob_digit[i] ^ b->ob_digit[i];
         break;
     default:
-        PyErr_BadArgument();
-        return NULL;
+        Py_UNREACHABLE();
     }
 
     /* Copy any remaining digits of a, inverting if necessary. */



More information about the Python-checkins mailing list