diff options
author | Stefan Krah <skrah@bytereef.org> | 2013-12-15 19:52:08 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2013-12-15 19:52:08 (GMT) |
commit | ae01a8bcdfb4117843e9e0f97ecac9aa9ffd7230 (patch) | |
tree | d4ec4c825eeb754478c47aadccd9ba8bfab73059 /Modules | |
parent | b2a794d235afd5da70ea1bc1c7f28a8379440a5b (diff) | |
parent | 1f1ec12db9eefa36bc7a2227c40ecdfcac945439 (diff) | |
download | cpython-ae01a8bcdfb4117843e9e0f97ecac9aa9ffd7230.zip cpython-ae01a8bcdfb4117843e9e0f97ecac9aa9ffd7230.tar.gz cpython-ae01a8bcdfb4117843e9e0f97ecac9aa9ffd7230.tar.bz2 |
Merge from 3.3.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_decimal/libmpdec/mpdecimal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index 05fd04d..21d2222 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -4421,21 +4421,22 @@ mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, const mpd_context_t *ctx, uint32_t *status) { uint32_t workstatus = 0; - const mpd_t *cc = c; + mpd_t *cc = NULL; if (result == c) { if ((cc = mpd_qncopy(c)) == NULL) { mpd_seterror(result, MPD_Malloc_error, status); return; } + c = cc; } _mpd_qmul(result, a, b, ctx, &workstatus); if (!(workstatus&MPD_Invalid_operation)) { - mpd_qadd(result, result, cc, ctx, &workstatus); + mpd_qadd(result, result, c, ctx, &workstatus); } - if (cc != c) mpd_del((mpd_t *)cc); + if (cc) mpd_del(cc); *status |= workstatus; } |