Permalink
Browse files

Avoid caml_copy_int{32,64} segfault on large uints

  • Loading branch information...
1 parent 9559a76 commit e3f8b2488784ad8552ab20eca7f9c37c1649ee1e @andrenth committed Feb 29, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/uint32_stubs.c
  2. +1 −1 lib/uint64_stubs.c
View
@@ -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
View
@@ -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

0 comments on commit e3f8b24

Please sign in to comment.