[GHC] #14850: mallocBytes allows underflow
GHC
ghc-devs at haskell.org
Mon Feb 26 21:13:25 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 glguy):
Switching to Word is more likely to hide mistakes as oversized allocations
due to wrap-around. I'd prefer to keep the computations at the Int type
and have the check implemented once in mallocBytes than to have to see
that check duplicated out to every caller of mallocBytes.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14850#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list