Skip to content

Commit

Permalink
BUG: fix issue with broken assert statement in templ_common.h.src
Browse files Browse the repository at this point in the history
assert() only takes one argument.
This was recently introduced, in commit 4156ae2 (numpygh-21793)
  • Loading branch information
rgommers committed Nov 12, 2022
1 parent 2ad596f commit 3a6d290
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numpy/core/src/common/templ_common.h.src
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/* utility functions that profit from templates */

#include "numpy/npy_common.h"
#include <assert.h>

/**begin repeat
* #name = int, uint, long, ulong,
Expand Down Expand Up @@ -57,8 +58,8 @@ npy_mul_sizes_with_overflow (npy_intp * r, npy_intp a, npy_intp b)
#ifdef HAVE___BUILTIN_MUL_OVERFLOW
return __builtin_mul_overflow(a, b, r);
#else

assert(a >= 0 && b >= 0, "this function only supports non-negative numbers");
/* this function only supports non-negative numbers */
assert(a >= 0 && b >= 0);
const npy_intp half_sz = ((npy_intp)1 << ((sizeof(a) * 8 - 1 ) / 2));

*r = a * b;
Expand Down

0 comments on commit 3a6d290

Please sign in to comment.