summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--arith.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f26c4ce5..0c524a1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-03-04 Kaz Kylheku <kaz@kylheku.com>
+ * arith.c (plus): Showstopper bug: plus(bignum, fixnum)
+ broken for fixnum <= 0. Bad pointer passed to MPI.
+
+2012-03-04 Kaz Kylheku <kaz@kylheku.com>
+
* mpi-patches/add-mp-hash (mp_hash): Fixed use of uninitialized
variable on platforms where the MP digit is smaller than a long integer.
(Not anything TXR is known to run on). Changed algorithm to take the
diff --git a/arith.c b/arith.c
index aed631a3..450b4e38 100644
--- a/arith.c
+++ b/arith.c
@@ -305,7 +305,7 @@ val plus(val anum, val bnum)
if (b > 0)
mp_add_d(mp(anum), bp, mp(n));
else
- mp_sub_d(mp(bnum), bp, mp(n));
+ mp_sub_d(mp(anum), bp, mp(n));
} else {
mp_int tmp;
mp_init(&tmp);