diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2012-04-20 20:42:49 (GMT) |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2012-04-20 20:42:49 (GMT) |
commit | bcc17eefd2b630aca2fc0f4e27f274a028030542 (patch) | |
tree | cb5ee87cd8a49f2f2a8fc4cac979e4ca35bca81c /Objects/longobject.c | |
parent | 63674f4b52aa7c2832fec09a026e24cd521e491b (diff) | |
download | cpython-bcc17eefd2b630aca2fc0f4e27f274a028030542.zip cpython-bcc17eefd2b630aca2fc0f4e27f274a028030542.tar.gz cpython-bcc17eefd2b630aca2fc0f4e27f274a028030542.tar.bz2 |
Issue #14630: Fix an incorrect access of ob_digit[0] for a zero instance of an int subclass.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 4 |
1 files changed, 1 insertions, 3 deletions
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 @@ _PyLong_Copy(PyLongObject *src) 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); |