summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/longobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index df69a6d..a28dbaf 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)