haskell / haskell/vector

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

未关闭
#118 10 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug design-shed
主要语言
Haskell
星标
400
派生
145
PR 合并指标
30 天内没有已合并 PR

描述

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.

``` haskell
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
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。