Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a10d426

Browse files
stratakisvstinner
authored andcommitted
bpo-36292: Mark unreachable code as such in long bitwise ops (GH-12333)
1 parent f7b57df commit a10d426

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Objects/longobject.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4637,8 +4637,7 @@ long_bitwise(PyLongObject *a,
46374637
size_z = negb ? size_b : size_a;
46384638
break;
46394639
default:
4640-
PyErr_BadArgument();
4641-
return NULL;
4640+
Py_UNREACHABLE();
46424641
}
46434642

46444643
/* We allow an extra digit if z is negative, to make sure that
@@ -4665,8 +4664,7 @@ long_bitwise(PyLongObject *a,
46654664
z->ob_digit[i] = a->ob_digit[i] ^ b->ob_digit[i];
46664665
break;
46674666
default:
4668-
PyErr_BadArgument();
4669-
return NULL;
4667+
Py_UNREACHABLE();
46704668
}
46714669

46724670
/* Copy any remaining digits of a, inverting if necessary. */

0 commit comments

Comments
 (0)