klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit 35450d1397acb1f43613a131df43111ef214eb16
parent 03c7d83a8726ed4467240275bc8f9bd59246f7a7
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Sat, 30 Apr 2011 14:43:03 -0300

Bugfix in imath.c: swap didn't correctly redirect self pointers from digits to single fields. Mailed Author with a fix.

Diffstat:
Msrc/imath.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/imath.c b/src/imath.c @@ -527,6 +527,13 @@ void mp_int_swap(mp_int a, mp_int c) *a = *c; *c = tmp; + /* Andres Navarro: bugfix */ + /* correct if digits was pointing to single */ + if (a->digits == &c->single) + a->digits = &a->single; + if (c->digits == &a->single) + c->digits = &c->single; + /* Andres Navarro: /bugfix */ } }