klisp

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

commit 5550f93a6c10f0ade3278776f33c85783e8390f9
parent c873d1b7d30cf5dd40c48a6360ab2e19a204d84e
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Tue, 12 Apr 2011 20:29:16 -0300

Bugfix: kbigint_try_fixint was assuming the single digit was in Bigint->single but in general it is in *(Bigint->digits)

Diffstat:
Msrc/kinteger.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kinteger.c b/src/kinteger.c @@ -21,7 +21,7 @@ inline TValue kbigint_try_fixint(klisp_State *K, TValue n) if (MP_USED(b) != 1) return n; - int64_t digit = (int64_t) MP_SINGLE(b); + int64_t digit = (int64_t) *(MP_DIGITS(b)); if (MP_SIGN(b) == MP_NEG) digit = -digit; if (kfit_int32_t(digit)) { /* n shouln't be reachable but the let the gc do its job */