From 285b8fa92b201b3f51d128d0e808b1f4c1ee248d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 28 Jun 2024 09:39:59 +0100 Subject: [PATCH] generator/daemon: Don't truncate 64 bit results from OCaml functions Commit d5b6f1df5f ("daemon: Allow parts of the daemon and APIs to be written in OCaml.", 2017) contained a bug where in any OCaml function that returns int64_t, the result was truncated to an int. This particularly affected part_get_gpt_attributes as that returns large 64 bit numbers, but probably affects other functions too, undetected. Fixes: commit d5b6f1df5ff2d387a5dfc89b8316c0dff67ce2c9 (cherry picked from commit 882ef4d93a2f8b150a66fa89f87ef1c4dd42de2f) --- generator/daemon.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/daemon.ml b/generator/daemon.ml index 5e2a78b91..78a2412d2 100644 --- a/generator/daemon.ml +++ b/generator/daemon.ml @@ -835,7 +835,7 @@ let generate_daemon_caml_stubs () = | RInt _ -> pr " CAMLreturnT (int, Int_val (retv));\n" | RInt64 _ -> - pr " CAMLreturnT (int, Int64_val (retv));\n" + pr " CAMLreturnT (int64_t, Int64_val (retv));\n" | RBool _ -> pr " CAMLreturnT (int, Bool_val (retv));\n" | RConstString _ -> assert false