]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36292: Mark unreachable code as such in long bitwise ops (GH-12333)
authorstratakis <cstratak@redhat.com>
Mon, 18 Mar 2019 17:59:20 +0000 (18:59 +0100)
committerVictor Stinner <vstinner@redhat.com>
Mon, 18 Mar 2019 17:59:20 +0000 (18:59 +0100)
Objects/longobject.c

index 1e3445c64a6a2bd88c1291a362e07f465deacc81..da697a784faad0be06296c97753029e38074f5d6 100644 (file)
@@ -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. */