summaryrefslogtreecommitdiffstats
path: root/arith.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-25 07:32:34 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-25 07:32:34 -0800
commit86cbd44a9b356ffe325887064e93363f8bec1b44 (patch)
tree687f77755f3fc3a8589ec7ca9c3e22373c802f4e /arith.c
parentb62de9326d9844661458c8f83e4c7ded5fa02f2d (diff)
downloadtxr-86cbd44a9b356ffe325887064e93363f8bec1b44.tar.gz
txr-86cbd44a9b356ffe325887064e93363f8bec1b44.tar.bz2
txr-86cbd44a9b356ffe325887064e93363f8bec1b44.zip
mul: add forgotten MPI error check.
* arith.c (mul): In code that is only compiled when HAVE_DOUBLE_INTPTR_T is missing/zero, we need to test the return value of MPI's mp_mul.
Diffstat (limited to 'arith.c')
-rw-r--r--arith.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arith.c b/arith.c
index 7289836e..f36c76ec 100644
--- a/arith.c
+++ b/arith.c
@@ -845,11 +845,14 @@ tail:
} else {
val n = make_bignum();
mp_int tmpb;
+ mp_err mpe;
mp_init(&tmpb);
mp_set_intptr(&tmpb, b);
mp_set_intptr(mp(n), a);
- mp_mul(mp(n), &tmpb, mp(n));
+ mpe = mp_mul(mp(n), &tmpb, mp(n));
mp_clear(&tmpb);
+ if (mpe != MP_OKAY)
+ do_mp_error(self, mpe);
return n;
}
#endif