fix bus error (misaligned data access) on SPARC in __decodeDouble_Int64
authorKarel Gardas <karel.gardas@centrum.cz>
Sun, 22 Mar 2015 20:58:03 +0000 (21:58 +0100)
committerKarel Gardas <karel.gardas@centrum.cz>
Sun, 22 Mar 2015 21:09:05 +0000 (22:09 +0100)
Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D749

rts/StgPrimFloat.c

index e2eeee5..277ae66 100644 (file)
@@ -182,9 +182,9 @@ __decodeDouble_Int64 (StgInt64 *const mantissa, const StgDouble dbl)
     I_ exp = 0;
 
     __decodeDouble_2Int (&man_sign, &man_high, &man_low, &exp, dbl);
-
-    *mantissa = ((((StgInt64)man_high << 32) | (StgInt64)man_low)
-                 * (StgInt64)man_sign);
+    ASSIGN_Int64((W_*)mantissa, ((((StgInt64)man_high << 32)
+                                  | (StgInt64)man_low)
+                                 * (StgInt64)man_sign));
     return exp;
 #endif
 }