From fde9807985ce5ba80d7fcc4957ad6b0f70acf0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 8 Jan 2007 10:17:31 +0000 Subject: [PATCH] More verbose debugging in case of assertion failure. XXX temporary for AIX problem. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19757 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/imath/imath.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/des/imath/imath.c b/lib/des/imath/imath.c index a0dc51d6e..83b3ada4f 100755 --- a/lib/des/imath/imath.c +++ b/lib/des/imath/imath.c @@ -34,6 +34,7 @@ #endif #include +#include #include #include @@ -3005,7 +3006,16 @@ static mp_result s_udiv(mp_int a, mp_int b) /* Solve for quotient digits, store in q.digits in reverse order */ while(r.digits >= da) { - assert(qpos <= q.alloc); + if (qpos > q.alloc) { + char buf[1024]; + printf("qpos = %d q.alloc = %d da = %d ua = %d\n", + (int)qpos, (int)q.alloc, (int)da, (int)ua); + mp_int_to_string(a, 10, buf, sizeof(buf)); + printf("a = %s\n", buf); + mp_int_to_string(b, 10, buf, sizeof(buf)); + printf("b = %s\n", buf); + assert(qpos <= q.alloc); + } if(s_ucmp(b, &r) > 0) { r.digits -= 1;