summaryrefslogtreecommitdiff
path: root/mpq/canonicalize.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpq/canonicalize.c')
-rw-r--r--mpq/canonicalize.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mpq/canonicalize.c b/mpq/canonicalize.c
index 7673249f0..a47cc0460 100644
--- a/mpq/canonicalize.c
+++ b/mpq/canonicalize.c
@@ -29,6 +29,9 @@ mpq_canonicalize (MP_RAT *op)
mpz_t gcd;
TMP_DECL (marker);
+ if (op->_mp_den._mp_size == 0)
+ DIVIDE_BY_ZERO;
+
TMP_MARK (marker);
/* ??? Dunno if the 1+ is needed. */