[commit: ghc] master: Fix build on Win64 (98810fe)

Ian Lynagh igloo at earth.li
Wed Jul 3 17:22:06 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/98810fe81d8e8c9122c206f08a4639c1a4a77f49

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

commit 98810fe81d8e8c9122c206f08a4639c1a4a77f49
Author: Ian Lynagh <ian at well-typed.com>
Date:   Tue Jul 2 14:59:08 2013 +0100

    Fix build on Win64
    
    gcc thought that fourthFloating could be used without being defined.
    In actual fact it couldn't, but I've refactored the code so that it
    can now see this.

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

 rts/Adjustor.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/rts/Adjustor.c b/rts/Adjustor.c
index 789bd69..873f3ac 100644
--- a/rts/Adjustor.c
+++ b/rts/Adjustor.c
@@ -491,22 +491,15 @@ createAdjustor(int cconv, StgStablePtr hptr,
 
     */
     {  
-        int i = 0;
-        int fourthFloating;
-        char *c;
         StgWord8 *adj_code;
 
         // determine whether we have 4 or more integer arguments,
         // and therefore need to flush one to the stack.
-        for (c = typeString; *c != '\0'; c++) {
-            i++;
-            if (i == 4) {
-                fourthFloating = (*c == 'f' || *c == 'd');
-                break;
-            }
-        }
+        if ((typeString[0] == '\0') ||
+            (typeString[1] == '\0') ||
+            (typeString[2] == '\0') ||
+            (typeString[3] == '\0')) {
 
-        if (i < 4) {
             adjustor = allocateExec(0x38,&code);
             adj_code = (StgWord8*)adjustor;
 
@@ -525,6 +518,9 @@ createAdjustor(int cconv, StgStablePtr hptr,
         }
         else
         {
+            int fourthFloating;
+
+            fourthFloating = (typeString[3] == 'f' || typeString[3] == 'd');
             adjustor = allocateExec(0x58,&code);
             adj_code = (StgWord8*)adjustor;
             *(StgInt32 *)adj_code        = 0x08ec8348;





More information about the ghc-commits mailing list