diff options
Diffstat (limited to 'mpn/generic')
-rw-r--r-- | mpn/generic/mullow_n.c | 4 | ||||
-rw-r--r-- | mpn/generic/pow_1.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/mpn/generic/mullow_n.c b/mpn/generic/mullow_n.c index e92a55461..3d2bd4132 100644 --- a/mpn/generic/mullow_n.c +++ b/mpn/generic/mullow_n.c @@ -57,6 +57,10 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ void mpn_mullow_n (mp_ptr rp, mp_srcptr xp, mp_srcptr yp, mp_size_t n) { + ASSERT (n >= 1); + ASSERT (! MPN_OVERLAP_P (rp, 2 * n, xp, n)); + ASSERT (! MPN_OVERLAP_P (rp, 2 * n, yp, n)); + if (BELOW_THRESHOLD (n, MULLOW_BASECASE_THRESHOLD)) { /* Allocate workspace of fixed size on stack: fast! */ diff --git a/mpn/generic/pow_1.c b/mpn/generic/pow_1.c index 4bc9f434b..88d66ea0e 100644 --- a/mpn/generic/pow_1.c +++ b/mpn/generic/pow_1.c @@ -34,6 +34,9 @@ mpn_pow_1 (mp_ptr rp, mp_srcptr bp, mp_size_t bn, mp_limb_t exp, mp_ptr tp) mp_size_t rn; int par; + ASSERT (bn >= 1); + /* FIXME: Add operand overlap criteria */ + if (exp <= 1) { if (exp == 0) |