ocaml-containers icon indicating copy to clipboard operation
ocaml-containers copied to clipboard

Bug with CCVector of Int32

Open RafaelBocquet opened this issue 1 year ago • 0 comments

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).

RafaelBocquet avatar Jun 27 '24 09:06 RafaelBocquet