[New-bugs-announce] [issue15107] Potential Bug in mpdecimal.c

Ken Cheung report at bugs.python.org
Tue Jun 19 17:59:21 CEST 2012

New submission from Ken Cheung <msrbugzilla at gmail.com>:

I observed a code clone from the following files.

function : mpd_qexp @ (file: "Python-3.3.0a4/Modules/_decimal/libmpdec/mpdecimal.c", line: 4092)~4165
function : mpd_qln @ (file: "Python-3.3.0a4/Modules/_decimal/libmpdec/mpdecimal.c", line: 4525)~4612

In the first few lines of this clone, the function mpd_qexp only calls mpd_setspecial when mpd_isnegative is false while the function mpd_qln calls mpd_setspecial independent of the value of mpd_isnegative. I wonder the checking is necessary in the function mpd_qln. The source code is included in the attachment. Hope it helps.

components: Library (Lib)
files: mpdecimal_clone.txt
messages: 163185
nosy: Ken.Cheung
priority: normal
severity: normal
status: open
title: Potential Bug in mpdecimal.c
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26051/mpdecimal_clone.txt

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list