aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-03-02 20:54:42 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:30 +0100
commit18eabd06e64d21f83f466e99de35302b238ffec7 (patch)
tree02944f2b91238f1c65e10b9907d738522e1af7c8
parent861a865cea33e0f8d84148dfbd64ab00beb1a54a (diff)
downloadotp-18eabd06e64d21f83f466e99de35302b238ffec7.tar.gz
otp-18eabd06e64d21f83f466e99de35302b238ffec7.tar.bz2
otp-18eabd06e64d21f83f466e99de35302b238ffec7.zip
erts: Fix compare order of hamt vs other types
MAP_DEF and HASHMAP_DEF must have adjacent values
-rw-r--r--erts/emulator/beam/erl_term.h30
-rw-r--r--erts/emulator/beam/utils.c8
2 files changed, 20 insertions, 18 deletions
diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h
index 264bf8bd74..953525a45c 100644
--- a/erts/emulator/beam/erl_term.h
+++ b/erts/emulator/beam/erl_term.h
@@ -1111,20 +1111,22 @@ _ET_DECLARE_CHECKED(Uint,y_reg_index,Uint)
#define LIST_DEF 0x1
#define NIL_DEF 0x2
#define MAP_DEF 0x3
-#define TUPLE_DEF 0x4
-#define PID_DEF 0x5
-#define EXTERNAL_PID_DEF 0x6
-#define PORT_DEF 0x7
-#define EXTERNAL_PORT_DEF 0x8
-#define EXPORT_DEF 0x9
-#define FUN_DEF 0xa
-#define REF_DEF 0xb
-#define EXTERNAL_REF_DEF 0xc
-#define ATOM_DEF 0xd
-#define FLOAT_DEF 0xe
-#define BIG_DEF 0xf
-#define SMALL_DEF 0x10
-#define HASHMAP_DEF 0x11
+#define HASHMAP_DEF 0x4
+#define TUPLE_DEF 0x5
+#define PID_DEF 0x6
+#define EXTERNAL_PID_DEF 0x7
+#define PORT_DEF 0x8
+#define EXTERNAL_PORT_DEF 0x9
+#define EXPORT_DEF 0xa
+#define FUN_DEF 0xb
+#define REF_DEF 0xc
+#define EXTERNAL_REF_DEF 0xd
+#define ATOM_DEF 0xe
+#define FLOAT_DEF 0xf
+#define BIG_DEF 0x10
+#define SMALL_DEF 0x11
+
+#define FIRST_VACANT_TAG_DEF 0x12
#if ET_DEBUG
extern unsigned tag_val_def_debug(Wterm, const char*, unsigned);
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 67331a37f6..3b35750fd7 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -830,10 +830,10 @@ Uint32 make_hash(Eterm term_arg)
unsigned op;
/* Must not collide with the real tag_val_def's: */
-#define MAKE_HASH_TUPLE_OP 0x11
-#define MAKE_HASH_TERM_ARRAY_OP 0x12
-#define MAKE_HASH_CDR_PRE_OP 0x13
-#define MAKE_HASH_CDR_POST_OP 0x14
+#define MAKE_HASH_TUPLE_OP (FIRST_VACANT_TAG_DEF)
+#define MAKE_HASH_TERM_ARRAY_OP (FIRST_VACANT_TAG_DEF+1)
+#define MAKE_HASH_CDR_PRE_OP (FIRST_VACANT_TAG_DEF+2)
+#define MAKE_HASH_CDR_POST_OP (FIRST_VACANT_TAG_DEF+3)
/*
** Convenience macro for calculating a bytewise hash on an unsigned 32 bit