]> granicus.if.org Git - python/commit
The previous code is correct, but hard to verify: The libmpdec documentation
authorStefan Krah <skrah@bytereef.org>
Wed, 18 Apr 2012 15:48:34 +0000 (17:48 +0200)
committerStefan Krah <skrah@bytereef.org>
Wed, 18 Apr 2012 15:48:34 +0000 (17:48 +0200)
commit140893cbaa086e0bcef9c47c11eaddd3015089c5
tree53bba0c22e1142810489c02180d579d020d7f9a8
parent447f0cc38673cfea3a6ede5aaf11e80e8e8181b2
The previous code is correct, but hard to verify: The libmpdec documentation
rightfully states that an mpd_t with a coefficient flagged as MPD_CONST_DATA
must not be in the position of the result operand. In this particular case
several assumptions guarantee that a resize will never occur in all possible
code paths, which was the reason for using MPD_CONST_DATA and saving an
instruction by omitting the initialization of tmp.alloc.

For readability, tmp is now flagged as MPD_STATIC_DATA and tmp.alloc
is initialized.
Modules/_decimal/libmpdec/mpdecimal.c