Skip to content

DV.Generic.Mutable.fill does not check for out of bounds access #118

Open
@Shimuuar

Description

@Shimuuar

So it should be either renamed as unsafeFill and/or bound checks added. It's possible this is not only one function with unsafe access.

module Fill where

import qualified Data.Vector.Unboxed.Mutable       as MU
import qualified Data.Vector.Generic.Mutable       as MG
import qualified Data.Vector.Fusion.Stream.Monadic as SS

main :: IO ()
main = do
  mv <- MU.replicate 10 (1 :: Int)
  MG.fill mv (SS.replicate 1000000 42)
  return ()
[1 of 1] Compiling Fill             ( /home/alexey/qqq/fill-sigsegv.hs, interpreted )
Ok, modules loaded: Fill.
*Fill> :main
Segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions