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.

Author mark.dickinson
Recipients brechtm, mark.dickinson, pitrou, skrah
Date 2012-04-20.12:18:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334924317.59.0.767222891976.issue14630@psf.upfronthosting.co.za>
In-reply-to
Content
Using MEDIUM_VALUE also works.

I'll cook up a patch tonight, after work.


diff -r 6762b943ee59 Objects/longobject.c
--- a/Objects/longobject.c	Tue Apr 17 21:42:07 2012 -0400
+++ b/Objects/longobject.c	Fri Apr 20 13:18:01 2012 +0100
@@ -156,9 +156,7 @@
     if (i < 0)
         i = -(i);
     if (i < 2) {
-        sdigit ival = src->ob_digit[0];
-        if (Py_SIZE(src) < 0)
-            ival = -ival;
+        sdigit ival = MEDIUM_VALUE(src);
         CHECK_SMALL_INT(ival);
     }
     result = _PyLong_New(i);
History
Date User Action Args
2012-04-20 12:18:37mark.dickinsonsetrecipients: + mark.dickinson, pitrou, skrah, brechtm
2012-04-20 12:18:37mark.dickinsonsetmessageid: <1334924317.59.0.767222891976.issue14630@psf.upfronthosting.co.za>
2012-04-20 12:18:37mark.dickinsonlinkissue14630 messages
2012-04-20 12:18:36mark.dickinsoncreate