aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2011-09-08 16:36:26 +0200
committerHenrik Nord <[email protected]>2011-09-08 16:36:26 +0200
commitf602ae4f0c727c1ff37e69887ba33f46b24c54e1 (patch)
tree340525e4b69e6971854de896b4f64d70b2224b0a /erts/emulator/beam/erl_nif.c
parent6fae573fc291f4a77282b918cae346064bece80e (diff)
parent262a9af33d3ceb4cb032c434b100cea7d4b0d60e (diff)
downloadotp-f602ae4f0c727c1ff37e69887ba33f46b24c54e1.tar.gz
otp-f602ae4f0c727c1ff37e69887ba33f46b24c54e1.tar.bz2
otp-f602ae4f0c727c1ff37e69887ba33f46b24c54e1.zip
Merge branch 'dev' into major
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index ea781a6cd0..f3db3f9326 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -578,7 +578,15 @@ int enif_is_identical(Eterm lhs, Eterm rhs)
int enif_compare(Eterm lhs, Eterm rhs)
{
- return CMP(lhs,rhs);
+ Sint result = CMP(lhs,rhs);
+
+ if (result < 0) {
+ return -1;
+ } else if (result > 0) {
+ return 1;
+ }
+
+ return result;
}
int enif_get_tuple(ErlNifEnv* env, Eterm tpl, int* arity, const Eterm** array)