This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Potential Bug in mpd_qresize and mpd_qresize_zero
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Ken.Cheung, skrah
Priority: normal Keywords:

Created on 2012-06-13 17:52 by Ken.Cheung, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mpdecimal_clone 2.txt Ken.Cheung, 2012-06-13 17:52
Messages (2)
msg162719 - (view) Author: Ken Cheung (Ken.Cheung) Date: 2012-06-13 17:52
I observed a code clone from the following files.

function : mpd_qresize @ (file: "Python-3.3.0a2/Modules/_decimal/libmpdec/mpdecimal.c", line: 481)~493
function : mpd_qresize_zero @ (file: "Python-3.3.0a2/Modules/_decimal/libmpdec/mpdecimal.c", line: 501)~517

The two functions perform different in the else if condition. I wonder this is due to functionality requirement or a bug. The source code is included in the attachment. Hope it helps.
msg162756 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-06-14 07:12
You can't return mpd_realloc_dyn(result, nwords, status) in the
second instance: the coefficient must be initialized to zero
later on. So this is intentional.
History
Date User Action Args
2022-04-11 14:57:31adminsetgithub: 59264
2012-06-14 07:13:01skrahsetstatus: open -> closed
2012-06-14 07:12:42skrahsetresolution: not a bug
messages: + msg162756
components: + Extension Modules, - Library (Lib)
stage: resolved
2012-06-13 18:34:36r.david.murraysetnosy: + skrah
2012-06-13 17:52:37Ken.Cheungcreate