Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bigarray 32bit interger overflow of offset in C imp. #11118

Merged
merged 2 commits into from Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -494,6 +494,9 @@ OCaml 4.14.0
- #11101, #11109: A recursive type constraint fails on 4.14
(Jacques Garrigue, report and review by Florian Angeletti)

- #11118: Fix integer overflow on 64-bit Windows when indexing bigarrays (which
could lead to a segmentation fault).
(Roven Gabriel, review by Nicolás Ojeda Bär and Xavier Leroy)

OCaml 4.13 maintenance branch
-----------------------------
Expand Down
2 changes: 1 addition & 1 deletion runtime/bigarray.c
Expand Up @@ -524,7 +524,7 @@ CAMLprim value caml_ba_create(value vkind, value vlayout, value vdim)
are within the bounds and return the offset of the corresponding
array element in the data part of the array. */

static long caml_ba_offset(struct caml_ba_array * b, intnat * index)
static intnat caml_ba_offset(struct caml_ba_array * b, intnat * index)
{
intnat offset;
int i;
Expand Down