File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.6.0 beta 1
1010Core and Builtins
1111-----------------
1212
13+ - Issue #25221: Fix corrupted result from PyLong_FromLong(0) when Python
14+ is compiled with NSMALLPOSINTS = 0.
15+
1316- Issue #27080: Implement formatting support for PEP 515. Initial patch
1417 by Chris Angelico.
1518
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ PyLong_FromLong(long ival)
234234 unsigned long abs_ival ;
235235 unsigned long t ; /* unsigned so >> doesn't propagate sign bit */
236236 int ndigits = 0 ;
237- int sign = 1 ;
237+ int sign ;
238238
239239 CHECK_SMALL_INT (ival );
240240
@@ -246,6 +246,7 @@ PyLong_FromLong(long ival)
246246 }
247247 else {
248248 abs_ival = (unsigned long )ival ;
249+ sign = ival == 0 ? 0 : 1 ;
249250 }
250251
251252 /* Fast path for single-digit ints */
You can’t perform that action at this time.
0 commit comments