[GHC] #1043: "Weird Number" crashes GHCi (and Hugs) when integer-divided by -1

GHC trac at galois.com
Fri Dec 8 12:09:18 EST 2006


#1043: "Weird Number" crashes GHCi (and Hugs) when integer-divided by -1
---------------------------------------+------------------------------------
    Reporter:  paul at thepottshouse.org  |       Owner:         
        Type:  bug                     |      Status:  new    
    Priority:  normal                  |   Milestone:         
   Component:  Compiler                |     Version:  6.6    
    Severity:  normal                  |    Keywords:         
  Difficulty:  Unknown                 |    Testcase:         
Architecture:  x86                     |          Os:  Windows
---------------------------------------+------------------------------------
(-2147483648::Int) `div` (-1::Int)

 This expression triggers a crash in GHCi on Windows XP, using the 6.6
 binary distribution. It generates zero on the PowerPC binary. This also
 affects HUGS.

 -2147483648 is the "weird number" (largest 32-bit negative) which has no
 positive counterpart representable in 32 bits.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1043>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list