8000 Add asserts · python/cpython@a0c619b · GitHub
[go: up one dir, main page]

Skip to content

Commit a0c619b

Browse files
committed
Add asserts
1 parent 59a5422 commit a0c619b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/mathmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,8 @@ math_pow_impl(PyObject *module, double x, double y)
29352935
else /* y < 0. */
29362936
A99B r = odd_y ? copysign(0., x) : 0.;
29372937
}
2938-
else { /* Py_IS_INFINITY(y) */
2938+
else {
2939+
assert(Py_IS_INFINITY(y));
29392940
if (fabs(x) == 1.0)
29402941
r = 1.;
29412942
else if (y > 0. && fabs(x) > 1.0)
@@ -3465,6 +3466,8 @@ static const uint8_t factorial_trailing_zeros[] = {
34653466
static PyObject *
34663467
perm_comb_small(unsigned long long n, unsigned long long k, int iscomb)
34673468
{
3469+
assert(k != 0);
3470+
34683471
/* For small enough n and k the result fits in the 64-bit range and can
34693472
* be calculated without allocating intermediate PyLong objects. */
34703473
if (iscomb) {

0 commit comments

Comments
 (0)
0