[GHC] #14850: mallocBytes allows underflow

GHC ghc-devs at haskell.org
Sun Feb 25 06:30:43 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:                    |
-------------------------------------+-------------------------------------
Changes (by osa1):

 * cc: osa1 (added)


Comment:

 `mallocBytes` does a conversion from `Int` (signed) to `CSize` (unsigned).
 On 64bit Linux system `Word` and `CSize` have the same size so this
 function could use `Word` as argument, but I wonder if this is always the
 case.

 In any case I think the argument should be an unsigned type (`Word`,
 `CSize`, or something else).

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


More information about the ghc-tickets mailing list