From 50f2c34f4aa111c09d2c1fc06944b11c08fb1743 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 16 Feb 2017 04:45:27 -0500 Subject: [PATCH] WIP --- runtime.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime.c b/runtime.c index cb47b786..fe0d85f2 100644 --- a/runtime.c +++ b/runtime.c @@ -3106,6 +3106,7 @@ object Cyc_expt(void *data, object cont, object z1, object z2) object Cyc_bignum_normalize(void *data, object n) { mp_int bn; + object result; if (!is_object_type(n) || type_of(n) != bignum_tag) { return n; } @@ -3113,12 +3114,13 @@ object Cyc_bignum_normalize(void *data, object n) mp_init(&bn); mp_set_int(&bn, CYC_FIXNUM_MAX); if (mp_cmp_mag(&bignum_value(n), &bn) == MP_GT) { - mp_clear(&bn); - return n; + result = n; } else { - mp_clear(&bn); - return obj_obj2int( TODO: get signed bignum int value + result = return obj_obj2int( TODO: get signed bignum int value } + + mp_clear(&bn); + return result; } /* I/O functions */