
#14850: mallocBytes allows underflow -------------------------------------+------------------------------------- Reporter: wyager | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 8.0.2 libraries/base | 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: -------------------------------------+------------------------------------- https://hackage.haskell.org/package/base-4.10.1.0/docs/src/Foreign.Marshal.A... This function doesn't complain when passed a negative number. Instead you get something like `*** Exception: malloc: resource exhausted (out of memory)` Which is confusing, and probably not consistent across platforms. This came up in https://github.com/tel/saltine/issues/42 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14850 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler