We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f30e7a8 commit 101f796Copy full SHA for 101f796
bitv.ml
@@ -36,7 +36,11 @@ let length v = v.length
36
37
let[@inline] equal (v1: t) (v2: t) = v1 = v2
38
39
-let max_length = Sys.max_string_length * 8
+let max_length =
40
+ let n = Sys.max_string_length * 8 in
41
+ (* We use 64 bits because it can overflow on architecture
42
+ with 32 bits integer like JS for instance. *)
43
+ if n < 0 then max_int else n
44
45
let exceeds_max_length n =
46
let s = n / 8 in
0 commit comments