diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-21 10:07:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-21 16:21:46 +0200 |
commit | abb70f9db4f8a2a818e8ca2d2edcce2ee9704bb1 (patch) | |
tree | 8dcb0d64ff8e98ed0a5622efef209bc014038642 /tools | |
parent | 6ac0dc7003ac51274d3c18dba33eb952deac2e45 (diff) |
ofz#3454 Floating-point-exception
Change-Id: I2432bff8e1c102b83f0b7aff1303a03539ce0350
Reviewed-on: https://gerrit.libreoffice.org/42580
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/fract.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 799ac4575018..7d89ae812e6f 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -189,7 +189,9 @@ namespace bool fail = false; fail |= o3tl::checked_multiply(i.numerator() / gcd1, num / gcd2, num); fail |= o3tl::checked_multiply(i.denominator() / gcd2, den / gcd1, den); - i.assign(num, den); + + if (!fail) + i.assign(num, den); return fail; } |