summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-17 10:43:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-17 10:43:44 (GMT)
commit3262fa4d4e2c631051f9ec0c76ff978be48cbda6 (patch)
tree9c2fd4f2dce23893f4a8287a690649d98e4a610e /generic/tclExecute.c
parente446f6c309fff33f6c76fb41f66d95bed3b81814 (diff)
parent37ad5db2968eee2ab488b989f8e0a05d53f05408 (diff)
downloadtcl-3262fa4d4e2c631051f9ec0c76ff978be48cbda6.zip
tcl-3262fa4d4e2c631051f9ec0c76ff978be48cbda6.tar.gz
tcl-3262fa4d4e2c631051f9ec0c76ff978be48cbda6.tar.bz2
Merge 8.7, more WIP
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 7d3d6bd..0ecdbfa 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -8161,16 +8161,13 @@ ExecuteExtendedBinaryMathOp(
if (err == MP_OKAY) {
err = mp_div(&big1, &big2, &bigResult, &bigRemainder);
}
- if (!mp_iszero(&bigRemainder) && (bigRemainder.sign != big2.sign)) {
+ if ((err == MP_OKAY) && !mp_iszero(&bigRemainder) && (bigRemainder.sign != big2.sign)) {
/*
* Convert to Tcl's integer division rules.
*/
- err = mp_sub_d(&bigResult, 1, &bigResult);
- if (err == MP_OKAY) {
- err = mp_add(&bigRemainder, &big2, &bigRemainder);
- }
- if (err != MP_OKAY) {
+ if ((mp_sub_d(&bigResult, 1, &bigResult) != MP_OKAY)
+ || (mp_add(&bigRemainder, &big2, &bigRemainder) != MP_OKAY)) {
return OUT_OF_MEMORY;
}
}