commit | bcc17eefd2b630aca2fc0f4e27f274a028030542 | [log] [tgz] |
---|---|---|
author | Mark Dickinson <mdickinson@enthought.com> | Fri Apr 20 21:42:49 2012 +0100 |
committer | Mark Dickinson <mdickinson@enthought.com> | Fri Apr 20 21:42:49 2012 +0100 |
tree | cb5ee87cd8a49f2f2a8fc4cac979e4ca35bca81c | |
parent | 63674f4b52aa7c2832fec09a026e24cd521e491b [diff] [blame] |
Issue #14630: Fix an incorrect access of ob_digit[0] for a zero instance of an int subclass.
diff --git a/Objects/longobject.c b/Objects/longobject.c index a0b16a6..a735e33 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c
@@ -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);