[erlang-bugs] Bug in enif_compare/2 for bignums
Filipe David Manana
Thu Sep 1 03:11:13 CEST 2011
I've found this apparently can only happen in 64 bits machines, where
sizeof(Sint) is smaller than sizeof(int).
The following patch fixes the issue for me:
On Wed, Aug 31, 2011 at 11:20 AM, Paul Davis
> I think I've uncovered a bug in enif_compare/2 for bignums. Converting
> the same arguments to ErlNifSInt64 values and using C comparison
> returns the correct result when enif_compare does not. There's a
> reduced test case at . If there's nothing obvious I'll spend some
> time later digging into Erlang to see if I can spot the bug.
> Paul Davis
>  https://github.com/davisp/enif_cmp_bug
> erlang-bugs mailing list
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
More information about the erlang-bugs