You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7795 Reporter:@kayceesrk Status: resolved (set by @xavierleroy on 2018-05-21T16:44:32Z) Resolution: fixed Priority: normal Severity: minor Fixed in version: 4.08.0+dev/beta1/beta2 Category: standard library Monitored by:@gasche
Bug description
Weak.create accepts -1 for the length. It should raise Invalid_argument for negative lengths. It appears that the bounds check in caml_weak_create is off by one.
Steps to reproduce
$ ocaml
OCaml version 4.08.0+dev0-2018-04-09
let v = Weak.create (-1);;
val v : '_weak1 Weak.t =
Weak.length v;;
: int = -1
The text was updated successfully, but these errors were encountered:
Original bug ID: 7795
Reporter: @kayceesrk
Status: resolved (set by @xavierleroy on 2018-05-21T16:44:32Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.08.0+dev/beta1/beta2
Category: standard library
Monitored by: @gasche
Bug description
Weak.create accepts -1 for the length. It should raise Invalid_argument for negative lengths. It appears that the bounds check in
caml_weak_create
is off by one.Steps to reproduce
$ ocaml
OCaml version 4.08.0+dev0-2018-04-09
let v = Weak.create (-1);;
val v : '_weak1 Weak.t =
Weak.length v;;
The text was updated successfully, but these errors were encountered: