diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-01-17 10:43:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-01-17 10:43:44 (GMT) |
commit | 3262fa4d4e2c631051f9ec0c76ff978be48cbda6 (patch) | |
tree | 9c2fd4f2dce23893f4a8287a690649d98e4a610e /generic/tclExecute.c | |
parent | e446f6c309fff33f6c76fb41f66d95bed3b81814 (diff) | |
parent | 37ad5db2968eee2ab488b989f8e0a05d53f05408 (diff) | |
download | tcl-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.c | 9 |
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; } } |