aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-08-21 17:07:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-08-22 05:02:20 -0700
commit3478fe3a92a8c85fa342a38ef3bf9bcc704bea94 (patch)
treeed1d4d55a46ec9cb8e5d0e1c6f4db262342505d7
parentea99fcd03875caf59ceda354ec8ed813bb5a5f79 (diff)
downloadglibc-3478fe3a92a8c85fa342a38ef3bf9bcc704bea94.zip
glibc-3478fe3a92a8c85fa342a38ef3bf9bcc704bea94.tar.gz
glibc-3478fe3a92a8c85fa342a38ef3bf9bcc704bea94.tar.bz2
rshift.c: Replace assert with DEBUG and aborthjl/gmp
assert in stdlib/rshift.c should be for debug purpose only and there is no such check in any rshift assembly implementations nor in lshift.c. This patch replaces assert with DEBUG and abort, similar to lshift.c so that generic GMP codes from libc.a can be linked with libc.so in atest-exp, atest-exp2 and atest-sincos, which depend on the GMP implementation in glibc. * stdlib/rshift.c (mpn_rshift): Replace ssert with DEBUG and abort.
-rw-r--r--stdlib/rshift.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stdlib/rshift.c b/stdlib/rshift.c
index d4c7f77..ab69dd7 100644
--- a/stdlib/rshift.c
+++ b/stdlib/rshift.c
@@ -42,7 +42,10 @@ mpn_rshift (register mp_ptr wp,
register mp_size_t i;
mp_limb_t retval;
- assert (usize != 0 && cnt != 0);
+#ifdef DEBUG
+ if (usize == 0 || cnt == 0)
+ abort ();
+#endif
sh_1 = cnt;