Skip to content

Commit

Permalink
Avoid caml_copy_int{32,64} segfault on large uints
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenth committed Feb 29, 2012
1 parent 9559a76 commit e3f8b24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/uint32_stubs.c
Expand Up @@ -172,7 +172,7 @@ CAMLprim value
uint32_to_int32(value v)
{
CAMLparam1(v);
CAMLreturn (caml_copy_int32(Uint32_val(v)));
CAMLreturn (caml_copy_int32((int32)Uint32_val(v)));
}

CAMLprim value
Expand Down
2 changes: 1 addition & 1 deletion lib/uint64_stubs.c
Expand Up @@ -186,7 +186,7 @@ CAMLprim value
uint64_to_int64(value v)
{
CAMLparam1(v);
CAMLreturn (caml_copy_int64(Uint64_val(v)));
CAMLreturn (caml_copy_int64((int64)Uint64_val(v)));
}

CAMLprim value
Expand Down

0 comments on commit e3f8b24

Please sign in to comment.