From: Tim Peters Date: Sat, 8 Jul 2000 02:26:47 +0000 (+0000) Subject: The tail end of x_sub implicitly assumed that an unsigned short X-Git-Tag: v2.0b1~1011 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43f04a36cf4e809a8baa3a895268b527bfd6254c;p=thirdparty%2FPython%2Fcpython.git The tail end of x_sub implicitly assumed that an unsigned short contains 16 bits. Not true on Cray J90. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index df69a6da67ac..a28dbaf34d7f 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1048,6 +1048,7 @@ x_sub(PyLongObject *a, PyLongObject *b) borrow = a->ob_digit[i] - borrow; z->ob_digit[i] = borrow & MASK; borrow >>= SHIFT; + borrow &= 1; /* Keep only one sign bit */ } assert(borrow == 0); if (sign < 0)