[commit: ghc] ghc-7.10: fix bus error (misaligned data access) on SPARC in __decodeDouble_Int64 (0b655e5)

git at git.haskell.org git at git.haskell.org
Sat Mar 28 23:43:02 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/0b655e5d89f6ebd1e3fb6b640d7f628b723c3c08/ghc

>---------------------------------------------------------------

commit 0b655e5d89f6ebd1e3fb6b640d7f628b723c3c08
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Sun Mar 22 21:58:03 2015 +0100

    fix bus error (misaligned data access) on SPARC in __decodeDouble_Int64
    
    Reviewers: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D749
    
    (cherry picked from commit 12a03c44c006f142f93980e0dbdfab0f73db042c)


>---------------------------------------------------------------

0b655e5d89f6ebd1e3fb6b640d7f628b723c3c08
 rts/StgPrimFloat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rts/StgPrimFloat.c b/rts/StgPrimFloat.c
index e2eeee5..277ae66 100644
--- a/rts/StgPrimFloat.c
+++ b/rts/StgPrimFloat.c
@@ -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
 }



More information about the ghc-commits mailing list