summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 817b7df1..7a0735aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-31 Kaz Kylheku <kaz@kylheku.com>
+
+ * lib.c (int_str): Fix gaping bug introduced by previous commit,
+ which could have been caught by running the regression test suite.
+ The revised function was returning small integers as bignums.
+
2012-10-30 Kaz Kylheku <kaz@kylheku.com>
* lib.c (string_lt): Bugfix: wcscmp returns some value less than zero,
diff --git a/lib.c b/lib.c
index b2c2f0d5..a9138199 100644
--- a/lib.c
+++ b/lib.c
@@ -2125,6 +2125,9 @@ val int_str(val str, val base)
return (LONG_MAX < NUM_MAX) ? normalize(bignum) : bignum;
}
+ if (value >= NUM_MIN && value <= NUM_MAX)
+ return num(value);
+
return bignum_from_long(value);
}