summaryrefslogtreecommitdiffstats
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
commit9a1bb60285df1183710bddf7bb22c878ee53a3cf (patch)
tree687f77755f3fc3a8589ec7ca9c3e22373c802f4e
parente3493d3b587f040033366d2e03fd784ab92fb1ef (diff)
downloadtxr-9a1bb60285df1183710bddf7bb22c878ee53a3cf.tar.gz
txr-9a1bb60285df1183710bddf7bb22c878ee53a3cf.tar.bz2
txr-9a1bb60285df1183710bddf7bb22c878ee53a3cf.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.
-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