alpha largeAdd fix
authorClaus Gittinger <cg@exept.de>
Sat, 27 Nov 1999 17:05:26 +0100
changeset 5022 0ca9250856e7
parent 5021 5d1dbd285d83
child 5023 5e98a2a3ea6f
alpha largeAdd fix
LargeInteger.st
--- a/LargeInteger.st	Sat Nov 27 00:28:46 1999 +0100
+++ b/LargeInteger.st	Sat Nov 27 17:05:26 1999 +0100
@@ -3503,9 +3503,12 @@
             while (_index <= _comLen3) {
                 UINT64 _sum;
 
-                _sum = _carry
-                        + *(unsigned *)(&(_myDigits[_index - 1]))
-                        + *(unsigned *)(&(_otherDigits[_index - 1]));
+                /* do not merge the 3 lines below into one -
+                 * (will do sign extension then, which is wrong here)
+                 */
+                _sum = (unsigned)_carry;
+                _sum += ((unsigned int *)(&(_myDigits[_index - 1])))[0];
+                _sum += ((unsigned int *)(&(_otherDigits[_index - 1])))[0];
                 _carry = _sum >> 32;
                 /* _sum = _sum & 0xFFFFFFFF; */
                 ((unsigned int *)(&(_newDigits[_index - 1])))[0] = _sum;
@@ -4301,5 +4304,5 @@
 !LargeInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.151 1999-11-26 12:43:34 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.152 1999-11-27 16:05:26 cg Exp $'
 ! !