-
Notifications
You must be signed in to change notification settings - Fork 19
The uint48 functions are both broken #79
Copy link
Copy link
Open
Description
(reported against Eio in ocaml-multicore/eio#418, which contains fixes and tests)
Lines 290 to 297 in c66fc02
| let write_uint48 t i = | |
| writable_exn t; | |
| ensure_space t 6; | |
| Bigstringaf.unsafe_set_int32_be t.buffer t.write_pos | |
| Int64.(to_int32 (shift_right_logical i 4)); | |
| Bigstringaf.unsafe_set_int16_be t.buffer (t.write_pos + 2) | |
| Int64.(to_int i); | |
| t.write_pos <- t.write_pos + 6 |
@adatario noticed that the shifts should be in bits, not bytes.
Also, the BE version gets the sizes of the chunks wrong (should be 16 then 32).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels