[GHC] #14850: mallocBytes allows underflow

GHC ghc-devs at haskell.org
Sun Feb 25 17:31:22 UTC 2018


#14850: mallocBytes allows underflow
-------------------------------------+-------------------------------------
        Reporter:  wyager            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by wyager):

 I agree, changing the argument type to Word is probably the most
 semantically sensible approach. It has the nice effect of shifting the
 responsibility of underflow detection to the caller.

 I think the ecosystem in general could benefit from a wide-ranging
 examination of whether “Int” is actually appropriate (indexing, lengths,
 etc.).

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14850#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list