]> granicus.if.org Git - python/commitdiff
Issue #27441: Remove some redundant assignments to ob_size in longobject.c. Thanks...
authorMark Dickinson <dickinsm@gmail.com>
Sat, 17 Sep 2016 18:44:13 +0000 (19:44 +0100)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 17 Sep 2016 18:44:13 +0000 (19:44 +0100)
Misc/NEWS
Objects/longobject.c

index a4da86489c5a16b5d38354cbfaafe5b9bbcbff89..088dfa941d1dd5b07973c637bb87b23d478dc7b1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1
 Core and Builtins
 -----------------
 
+- Issue #27441: Remove some redundant assignments to ob_size in longobject.c.
+  Thanks Oren Milman.
+
 - Issue #27222: Clean up redundant code in long_rshift function. Thanks
   Oren Milman.
 
index 0822f9bcb30eabe2d96466a1846cfb7e9c75fdde..0ecbab1fba3998c310e148a306e4a2931efc745c 100644 (file)
@@ -315,7 +315,6 @@ PyLong_FromUnsignedLong(unsigned long ival)
     v = _PyLong_New(ndigits);
     if (v != NULL) {
         digit *p = v->ob_digit;
-        Py_SIZE(v) = ndigits;
         while (ival) {
             *p++ = (digit)(ival & PyLong_MASK);
             ival >>= PyLong_SHIFT;
@@ -1102,7 +1101,6 @@ PyLong_FromUnsignedLongLong(unsigned long long ival)
     v = _PyLong_New(ndigits);
     if (v != NULL) {
         digit *p = v->ob_digit;
-        Py_SIZE(v) = ndigits;
         while (ival) {
             *p++ = (digit)(ival & PyLong_MASK);
             ival >>= PyLong_SHIFT;