Skip to content

Commit 6a11909

Browse files
committed
the unsafe removal fix an out of bounds bug
1 parent 0376138 commit 6a11909

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jscomp/test/string_runtime_test.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ let suites = Mt.[
1414
"caml_string_of_bytes", (fun _ ->
1515

1616
let f len =
17-
let b = Bytes.create 1000 in
18-
Bytes.unsafe_fill b 0 len 'c';
19-
(B.bytes_to_string b, (String.init len (fun _ -> 'c'))) in
17+
let b = Bytes.create len in
18+
Bytes.fill b 0 len 'c';
19+
(Bytes.to_string b, (String.init len (fun _ -> 'c'))) in
2020
let (a,b) =
2121
List.split @@ List.map (fun x -> f x ) [1000;1024;1025;4095;4096;5000;10000] in
2222
Eq(a,b)

0 commit comments

Comments
 (0)