Ticket #2223: ghc-6.8.2-Int64-toInteger.patch

File ghc-6.8.2-Int64-toInteger.patch, 512 bytes (added by gnezdo, 6 years ago)

Proposed patch. Courtesy of Mike Gunter.

  • PrimOps.cmm

    old new  
    450450   hi = TO_W_(val >> 32); 
    451451   lo = TO_W_(val); 
    452452 
    453    if ( hi != 0 && hi != 0xFFFFFFFF )  {  
    454        words_needed = 2; 
    455    } else {  
    456        // minimum is one word 
     453   if ( hi == 0 || (hi == 0xFFFFFFFF && lo != 0) )  {  
    457454       words_needed = 1; 
     455       // minimum is one word 
     456   } else {  
     457       words_needed = 2; 
    458458   } 
    459459 
    460460   ALLOC_PRIM( SIZEOF_StgArrWords + WDS(words_needed),