ocaml-containers
ocaml-containers copied to clipboard
Bug with CCVector of Int32
The following code
let () =
let arr : Int32.t CCVector.vector = CCVector.create () in
CCVector.push arr (Int32.of_int 123456);
Format.printf "%d\n" (Int32.to_int (CCVector.get arr 0));
let x = CCVector.get arr 0 in
Format.printf "%d\n" (Int32.to_int x)
produces the following output:
123456
1024
when compiled to native code (ocamlfind ocamlopt -linkpkg -package containers -o main main.ml).
It produces the expected output when compiled to bytecode (ocamlfind ocamlc -linkpkg -package containers -o main main.ml).