summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-04-24 13:15:26 +0000
committerIan Lynagh <igloo@earth.li>2008-04-24 13:15:26 +0000
commit372a8212471344d55128b7bffc9cf8bb962ae742 (patch)
tree4538bf9908af956093b36ffdee98e0ecca8573fd /rts/PrimOps.cmm
parent6821c8a47c0fc61a2d989d368f926cc0ded776e9 (diff)
downloadhaskell-372a8212471344d55128b7bffc9cf8bb962ae742.tar.gz
Fix int64ToInteger 0xFFFFFFFF00000000 on 32bit machine; trac #2223
Patch from Mike Gunter.
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index cbdfe67d93..6c3593e4a4 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -452,11 +452,11 @@ int64ToIntegerzh_fast
hi = TO_W_(val >> 32);
lo = TO_W_(val);
- if ( hi != 0 && hi != 0xFFFFFFFF ) {
- words_needed = 2;
- } else {
+ if ( hi == 0 || (hi == 0xFFFFFFFF && lo != 0) ) {
// minimum is one word
words_needed = 1;
+ } else {
+ words_needed = 2;
}
ALLOC_PRIM( SIZEOF_StgArrWords + WDS(words_needed),